pull/7529/head
Phillip Webb 8 years ago
parent 491bd745de
commit 357d072a60

@ -18,11 +18,11 @@
<main.basedir>${basedir}/..</main.basedir>
</properties>
<dependencies>
<!-- Compile -->
<dependency>
<groupId>org.springframework.hateoas</groupId>
<artifactId>spring-hateoas</artifactId>
</dependency>
<!-- Provided -->
<dependency>
<groupId>org.springframework.boot</groupId>

@ -49,8 +49,7 @@ import org.springframework.context.annotation.Primary;
public class CouchbaseAutoConfiguration {
@Configuration
@ConditionalOnMissingBean(value = CouchbaseConfiguration.class,
type = "org.springframework.data.couchbase.config.CouchbaseConfigurer")
@ConditionalOnMissingBean(value = CouchbaseConfiguration.class, type = "org.springframework.data.couchbase.config.CouchbaseConfigurer")
public static class CouchbaseConfiguration {
private final CouchbaseProperties properties;
@ -124,8 +123,9 @@ public class CouchbaseAutoConfiguration {
* Determine if Couchbase should be configured. This happens if either the
* user-configuration defines a {@code CouchbaseConfigurer} or if at least the
* "bootstrapHosts" property is specified.
* <p>The reason why we check for the presence of {@code CouchbaseConfigurer} is
* that it might use {@link CouchbaseProperties} for its internal customization.
* <p>
* 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 {

@ -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 {
}
}

@ -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 {

@ -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;
}

Loading…
Cancel
Save