diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/thread/Threading.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/thread/Threading.java index 1f32fa1170..b82e29953f 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/thread/Threading.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/thread/Threading.java @@ -31,22 +31,25 @@ public enum Threading { * Platform threads. Active if virtual threads are not active. */ PLATFORM { + @Override public boolean isActive(Environment environment) { return !VIRTUAL.isActive(environment); } + }, /** * Virtual threads. Active if {@code spring.threads.virtual.enabled} is {@code true} * and running on Java 21 or later. */ VIRTUAL { + @Override public boolean isActive(Environment environment) { - boolean virtualThreadsEnabled = environment.getProperty("spring.threads.virtual.enabled", boolean.class, - false); - return virtualThreadsEnabled && JavaVersion.getJavaVersion().isEqualOrNewerThan(JavaVersion.TWENTY_ONE); + return environment.getProperty("spring.threads.virtual.enabled", boolean.class, false) + && JavaVersion.getJavaVersion().isEqualOrNewerThan(JavaVersion.TWENTY_ONE); } + }; /** diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQAutoConfigurationTests.java index 3e1b0980d8..2815e3e2ff 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQAutoConfigurationTests.java @@ -289,6 +289,7 @@ class ActiveMQAutoConfigurationTests { @Bean ActiveMQConnectionDetails activemqConnectionDetails() { return new ActiveMQConnectionDetails() { + @Override public String getBrokerUrl() { return "tcp://localhost:12345"; @@ -303,6 +304,7 @@ class ActiveMQAutoConfigurationTests { public String getPassword() { return "spring"; } + }; } diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/observability.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/observability.adoc index 9d8cd3b0ef..2b8fcccdb4 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/observability.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/observability.adoc @@ -67,6 +67,8 @@ include::code:MyObservationPredicate[] The preceding example will prevent all observations whose name contains "denied". + + [[actuator.observability.opentelemetry]] === OpenTelemetry Support Spring Boot's actuator module includes basic support for https://opentelemetry.io/[OpenTelemetry]. diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/AbstractRunMojo.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/AbstractRunMojo.java index 9ca1409757..18a4009620 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/AbstractRunMojo.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/AbstractRunMojo.java @@ -39,6 +39,7 @@ import org.apache.maven.project.MavenProject; import org.apache.maven.toolchain.ToolchainManager; import org.springframework.boot.loader.tools.FileUtils; +import org.springframework.util.Assert; import org.springframework.util.ObjectUtils; /** @@ -373,10 +374,8 @@ public abstract class AbstractRunMojo extends AbstractDependencyFilterMojo { @SuppressWarnings("removal") private void addAdditionalClasspathLocations(List urls) throws MalformedURLException { - if (!ObjectUtils.isEmpty(this.directories) && !ObjectUtils.isEmpty(this.additionalClasspathElements)) { - throw new IllegalStateException( - "Either additionalClasspathElements or directories (deprecated) should be set, not both"); - } + Assert.state(ObjectUtils.isEmpty(this.directories) || ObjectUtils.isEmpty(this.additionalClasspathElements), + "Either additionalClasspathElements or directories (deprecated) should be set, not both"); String[] elements = !ObjectUtils.isEmpty(this.additionalClasspathElements) ? this.additionalClasspathElements : this.directories; if (elements != null) {