Closes gh-14023
pull/14024/merge
Johnny Lim 6 years ago committed by Stephane Nicoll
parent c8570a9459
commit 101cc59b7d

@ -54,17 +54,17 @@ class DefaultEndpointObjectNameFactory implements EndpointObjectNameFactory {
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
private static boolean determineUniqueNames(Environment environment, private static boolean determineUniqueNames(Environment environment,
JmxEndpointProperties properties) { JmxEndpointProperties properties) {
Boolean uniqueName = environment.getProperty("spring.jmx.unique-names", Boolean uniqueNames = environment.getProperty("spring.jmx.unique-names",
Boolean.class); Boolean.class);
Boolean endpointUniqueNames = properties.getUniqueNames(); Boolean endpointUniqueNames = properties.getUniqueNames();
if (uniqueName == null) { if (uniqueNames == null) {
return (endpointUniqueNames != null) ? endpointUniqueNames : false; return (endpointUniqueNames != null) ? endpointUniqueNames : false;
} }
else if (endpointUniqueNames != null & !uniqueName.equals(endpointUniqueNames)) { if (endpointUniqueNames != null & !uniqueNames.equals(endpointUniqueNames)) {
throw new IllegalArgumentException( throw new IllegalArgumentException(
"Configuration mismatch, 'management.endpoints.jmx.unique-names' is deprecated, use only 'spring.jmx.unique-names'"); "Configuration mismatch, 'management.endpoints.jmx.unique-names' is deprecated, use only 'spring.jmx.unique-names'");
} }
return uniqueName; return uniqueNames;
} }
@Override @Override

@ -180,9 +180,9 @@ public class FlywayAutoConfiguration {
} }
private void checkLocationExists(Flyway flyway) { private void checkLocationExists(Flyway flyway) {
if (this.properties.isCheckLocation()) {
String[] locations = new LocationResolver(flyway.getDataSource()) String[] locations = new LocationResolver(flyway.getDataSource())
.resolveLocations(this.properties.getLocations()); .resolveLocations(this.properties.getLocations());
if (this.properties.isCheckLocation()) {
Assert.state(locations.length != 0, Assert.state(locations.length != 0,
"Migration script locations not configured"); "Migration script locations not configured");
boolean exists = hasAtLeastOneLocation(locations); boolean exists = hasAtLeastOneLocation(locations);

@ -94,9 +94,9 @@ public class JmxAutoConfiguration implements EnvironmentAware, BeanFactoryAware
if (StringUtils.hasLength(defaultDomain)) { if (StringUtils.hasLength(defaultDomain)) {
namingStrategy.setDefaultDomain(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); Boolean.class, false);
namingStrategy.setEnsureUniqueRuntimeObjectNames(uniqueName); namingStrategy.setEnsureUniqueRuntimeObjectNames(uniqueNames);
return namingStrategy; return namingStrategy;
} }

Loading…
Cancel
Save