The reason why we check for the presence of {@code CouchbaseConfigurer} is - * that it might use {@link CouchbaseProperties} for its internal customization. + *
+ * The reason why we check for the presence of {@code CouchbaseConfigurer} is that it + * might use {@link CouchbaseProperties} for its internal customization. */ static class CouchbaseCondition extends AnyNestedCondition { diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/ConditionalOnMissingBeanWithFilteredClasspathTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/ConditionalOnMissingBeanWithFilteredClasspathTests.java index e19f41e09a6..e7cf409d0e4 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/ConditionalOnMissingBeanWithFilteredClasspathTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/ConditionalOnMissingBeanWithFilteredClasspathTests.java @@ -53,7 +53,6 @@ public class ConditionalOnMissingBeanWithFilteredClasspathTests { assertThat(this.context.containsBean("foo")).isTrue(); } - @Configuration static class OnBeanTypeConfiguration { @@ -66,6 +65,7 @@ public class ConditionalOnMissingBeanWithFilteredClasspathTests { } static class TestCacheManager extends CaffeineCacheManager { + } } diff --git a/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/orm/jpa/TestDatabaseAutoConfigurationTests.java b/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/orm/jpa/TestDatabaseAutoConfigurationTests.java index afe99954ce9..8f20b2d2323 100644 --- a/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/orm/jpa/TestDatabaseAutoConfigurationTests.java +++ b/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/orm/jpa/TestDatabaseAutoConfigurationTests.java @@ -60,7 +60,6 @@ public class TestDatabaseAutoConfigurationTests { DataSource datasource = this.context.getBean(DataSource.class); JdbcTemplate jdbcTemplate = new JdbcTemplate(datasource); jdbcTemplate.execute("create table example (id int, name varchar);"); - ConfigurableApplicationContext anotherContext = doLoad( ExistingDataSourceConfiguration.class); try { diff --git a/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/Handler.java b/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/Handler.java index 7d801bcbe44..949504b4ff0 100644 --- a/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/Handler.java +++ b/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/Handler.java @@ -198,24 +198,23 @@ public class Handler extends URLStreamHandler { @Override protected int hashCode(URL u) { - int result = 0; - String protocol = u.getProtocol(); - if (protocol != null) { - result += protocol.hashCode(); - } - String file = u.getFile(); + return hashCode(u.getProtocol(), u.getFile()); + } + + private int hashCode(String protocol, String file) { + int result = (protocol == null ? 0 : protocol.hashCode()); int separatorIndex = file.indexOf(SEPARATOR); if (separatorIndex == -1) { return result + file.hashCode(); } - String fileWithoutEntry = file.substring(0, separatorIndex); + String source = file.substring(0, separatorIndex); + String entry = canonicalize(file.substring(separatorIndex + 2)); try { - result += new URL(fileWithoutEntry).hashCode(); + result += new URL(source).hashCode(); } catch (MalformedURLException ex) { - result += fileWithoutEntry.hashCode(); + result += source.hashCode(); } - String entry = canonicalize(file.substring(separatorIndex + 2)); result += entry.hashCode(); return result; }