mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-09-17 12:09:16 +00:00
Add nullability annotations to module/spring-boot-artemis
See gh-46587
This commit is contained in:
+5
-4
@@ -18,6 +18,7 @@ package org.springframework.boot.artemis.autoconfigure;
|
||||
|
||||
import jakarta.jms.ConnectionFactory;
|
||||
import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
@@ -69,22 +70,22 @@ public final class ArtemisAutoConfiguration {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArtemisMode getMode() {
|
||||
public @Nullable ArtemisMode getMode() {
|
||||
return this.properties.getMode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBrokerUrl() {
|
||||
public @Nullable String getBrokerUrl() {
|
||||
return this.properties.getBrokerUrl();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUser() {
|
||||
public @Nullable String getUser() {
|
||||
return this.properties.getUser();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPassword() {
|
||||
public @Nullable String getPassword() {
|
||||
return this.properties.getPassword();
|
||||
}
|
||||
|
||||
|
||||
+6
-4
@@ -16,6 +16,8 @@
|
||||
|
||||
package org.springframework.boot.artemis.autoconfigure;
|
||||
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
import org.springframework.boot.autoconfigure.service.connection.ConnectionDetails;
|
||||
|
||||
/**
|
||||
@@ -30,24 +32,24 @@ public interface ArtemisConnectionDetails extends ConnectionDetails {
|
||||
* Artemis deployment mode, auto-detected by default.
|
||||
* @return the Artemis deployment mode, auto-detected by default
|
||||
*/
|
||||
ArtemisMode getMode();
|
||||
@Nullable ArtemisMode getMode();
|
||||
|
||||
/**
|
||||
* Artemis broker url.
|
||||
* @return the Artemis broker url
|
||||
*/
|
||||
String getBrokerUrl();
|
||||
@Nullable String getBrokerUrl();
|
||||
|
||||
/**
|
||||
* Login user of the broker.
|
||||
* @return the login user of the broker
|
||||
*/
|
||||
String getUser();
|
||||
@Nullable String getUser();
|
||||
|
||||
/**
|
||||
* Login password of the broker.
|
||||
* @return the login password of the broker
|
||||
*/
|
||||
String getPassword();
|
||||
@Nullable String getPassword();
|
||||
|
||||
}
|
||||
|
||||
+2
-1
@@ -17,6 +17,7 @@
|
||||
package org.springframework.boot.artemis.autoconfigure;
|
||||
|
||||
import org.apache.activemq.artemis.spi.core.naming.BindingRegistry;
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* A no-op implementation of the {@link BindingRegistry}.
|
||||
@@ -28,7 +29,7 @@ import org.apache.activemq.artemis.spi.core.naming.BindingRegistry;
|
||||
public class ArtemisNoOpBindingRegistry implements BindingRegistry {
|
||||
|
||||
@Override
|
||||
public Object lookup(String s) {
|
||||
public @Nullable Object lookup(String s) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
+16
-15
@@ -22,6 +22,7 @@ import java.util.UUID;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import org.apache.activemq.artemis.core.remoting.impl.invm.TransportConstants;
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.boot.context.properties.NestedConfigurationProperty;
|
||||
@@ -41,57 +42,57 @@ public class ArtemisProperties {
|
||||
/**
|
||||
* Artemis deployment mode, auto-detected by default.
|
||||
*/
|
||||
private ArtemisMode mode;
|
||||
private @Nullable ArtemisMode mode;
|
||||
|
||||
/**
|
||||
* Artemis broker url.
|
||||
*/
|
||||
private String brokerUrl;
|
||||
private @Nullable String brokerUrl;
|
||||
|
||||
/**
|
||||
* Login user of the broker.
|
||||
*/
|
||||
private String user;
|
||||
private @Nullable String user;
|
||||
|
||||
/**
|
||||
* Login password of the broker.
|
||||
*/
|
||||
private String password;
|
||||
private @Nullable String password;
|
||||
|
||||
private final Embedded embedded = new Embedded();
|
||||
|
||||
@NestedConfigurationProperty
|
||||
private final JmsPoolConnectionFactoryProperties pool = new JmsPoolConnectionFactoryProperties();
|
||||
|
||||
public ArtemisMode getMode() {
|
||||
public @Nullable ArtemisMode getMode() {
|
||||
return this.mode;
|
||||
}
|
||||
|
||||
public void setMode(ArtemisMode mode) {
|
||||
public void setMode(@Nullable ArtemisMode mode) {
|
||||
this.mode = mode;
|
||||
}
|
||||
|
||||
public String getBrokerUrl() {
|
||||
public @Nullable String getBrokerUrl() {
|
||||
return this.brokerUrl;
|
||||
}
|
||||
|
||||
public void setBrokerUrl(String brokerUrl) {
|
||||
public void setBrokerUrl(@Nullable String brokerUrl) {
|
||||
this.brokerUrl = brokerUrl;
|
||||
}
|
||||
|
||||
public String getUser() {
|
||||
public @Nullable String getUser() {
|
||||
return this.user;
|
||||
}
|
||||
|
||||
public void setUser(String user) {
|
||||
public void setUser(@Nullable String user) {
|
||||
this.user = user;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
public @Nullable String getPassword() {
|
||||
return this.password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
public void setPassword(@Nullable String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
@@ -128,7 +129,7 @@ public class ArtemisProperties {
|
||||
/**
|
||||
* Journal file directory. Not necessary if persistence is turned off.
|
||||
*/
|
||||
private String dataDirectory;
|
||||
private @Nullable String dataDirectory;
|
||||
|
||||
/**
|
||||
* List of queues to create on startup.
|
||||
@@ -171,11 +172,11 @@ public class ArtemisProperties {
|
||||
this.persistent = persistent;
|
||||
}
|
||||
|
||||
public String getDataDirectory() {
|
||||
public @Nullable String getDataDirectory() {
|
||||
return this.dataDirectory;
|
||||
}
|
||||
|
||||
public void setDataDirectory(String dataDirectory) {
|
||||
public void setDataDirectory(@Nullable String dataDirectory) {
|
||||
this.dataDirectory = dataDirectory;
|
||||
}
|
||||
|
||||
|
||||
+3
@@ -19,4 +19,7 @@
|
||||
*
|
||||
* @author Eddú Meléndez
|
||||
*/
|
||||
@NullMarked
|
||||
package org.springframework.boot.artemis.autoconfigure;
|
||||
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
|
||||
+4
-2
@@ -16,6 +16,8 @@
|
||||
|
||||
package org.springframework.boot.artemis.docker.compose;
|
||||
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
import org.springframework.boot.artemis.autoconfigure.ArtemisConnectionDetails;
|
||||
import org.springframework.boot.artemis.autoconfigure.ArtemisMode;
|
||||
import org.springframework.boot.docker.compose.core.RunningService;
|
||||
@@ -71,12 +73,12 @@ class ArtemisDockerComposeConnectionDetailsFactory
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUser() {
|
||||
public @Nullable String getUser() {
|
||||
return this.environment.getUser();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPassword() {
|
||||
public @Nullable String getPassword() {
|
||||
return this.environment.getPassword();
|
||||
}
|
||||
|
||||
|
||||
+6
-4
@@ -18,6 +18,8 @@ package org.springframework.boot.artemis.docker.compose;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* Artemis environment details.
|
||||
*
|
||||
@@ -26,20 +28,20 @@ import java.util.Map;
|
||||
*/
|
||||
class ArtemisEnvironment {
|
||||
|
||||
private final String user;
|
||||
private final @Nullable String user;
|
||||
|
||||
private final String password;
|
||||
private final @Nullable String password;
|
||||
|
||||
ArtemisEnvironment(Map<String, String> env) {
|
||||
this.user = env.get("ARTEMIS_USER");
|
||||
this.password = env.get("ARTEMIS_PASSWORD");
|
||||
}
|
||||
|
||||
String getUser() {
|
||||
@Nullable String getUser() {
|
||||
return this.user;
|
||||
}
|
||||
|
||||
String getPassword() {
|
||||
@Nullable String getPassword() {
|
||||
return this.password;
|
||||
}
|
||||
|
||||
|
||||
+3
@@ -17,4 +17,7 @@
|
||||
/**
|
||||
* Support for Docker Compose Artemis service connections.
|
||||
*/
|
||||
@NullMarked
|
||||
package org.springframework.boot.artemis.docker.compose;
|
||||
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
|
||||
+3
-2
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.springframework.boot.artemis.testcontainers;
|
||||
|
||||
import org.jspecify.annotations.Nullable;
|
||||
import org.testcontainers.activemq.ArtemisContainer;
|
||||
|
||||
import org.springframework.boot.artemis.autoconfigure.ArtemisConnectionDetails;
|
||||
@@ -57,12 +58,12 @@ class ArtemisContainerConnectionDetailsFactory
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUser() {
|
||||
public @Nullable String getUser() {
|
||||
return getContainer().getUser();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPassword() {
|
||||
public @Nullable String getPassword() {
|
||||
return getContainer().getPassword();
|
||||
}
|
||||
|
||||
|
||||
+3
@@ -17,4 +17,7 @@
|
||||
/**
|
||||
* Support for testcontainers Artemis service connections.
|
||||
*/
|
||||
@NullMarked
|
||||
package org.springframework.boot.artemis.testcontainers;
|
||||
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
|
||||
Reference in New Issue
Block a user