diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/jmx/DefaultEndpointObjectNameFactory.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/jmx/DefaultEndpointObjectNameFactory.java index 9476b10244..5726a41d9a 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/jmx/DefaultEndpointObjectNameFactory.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/jmx/DefaultEndpointObjectNameFactory.java @@ -54,17 +54,17 @@ class DefaultEndpointObjectNameFactory implements EndpointObjectNameFactory { @SuppressWarnings("deprecation") private static boolean determineUniqueNames(Environment environment, JmxEndpointProperties properties) { - Boolean uniqueName = environment.getProperty("spring.jmx.unique-names", + Boolean uniqueNames = environment.getProperty("spring.jmx.unique-names", Boolean.class); Boolean endpointUniqueNames = properties.getUniqueNames(); - if (uniqueName == null) { + if (uniqueNames == null) { return (endpointUniqueNames != null) ? endpointUniqueNames : false; } - else if (endpointUniqueNames != null & !uniqueName.equals(endpointUniqueNames)) { + if (endpointUniqueNames != null & !uniqueNames.equals(endpointUniqueNames)) { throw new IllegalArgumentException( "Configuration mismatch, 'management.endpoints.jmx.unique-names' is deprecated, use only 'spring.jmx.unique-names'"); } - return uniqueName; + return uniqueNames; } @Override diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration.java index da93e098cf..bd66b057a7 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration.java @@ -180,9 +180,9 @@ public class FlywayAutoConfiguration { } private void checkLocationExists(Flyway flyway) { - String[] locations = new LocationResolver(flyway.getDataSource()) - .resolveLocations(this.properties.getLocations()); if (this.properties.isCheckLocation()) { + String[] locations = new LocationResolver(flyway.getDataSource()) + .resolveLocations(this.properties.getLocations()); Assert.state(locations.length != 0, "Migration script locations not configured"); boolean exists = hasAtLeastOneLocation(locations); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jmx/JmxAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jmx/JmxAutoConfiguration.java index 4bcd4ac82f..7ad04ac766 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jmx/JmxAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jmx/JmxAutoConfiguration.java @@ -94,9 +94,9 @@ public class JmxAutoConfiguration implements EnvironmentAware, BeanFactoryAware if (StringUtils.hasLength(defaultDomain)) { namingStrategy.setDefaultDomain(defaultDomain); } - boolean uniqueName = this.environment.getProperty("spring.jmx.unique-names", + boolean uniqueNames = this.environment.getProperty("spring.jmx.unique-names", Boolean.class, false); - namingStrategy.setEnsureUniqueRuntimeObjectNames(uniqueName); + namingStrategy.setEnsureUniqueRuntimeObjectNames(uniqueNames); return namingStrategy; }