Polishing

This commit is contained in:
Juergen Hoeller
2018-06-28 17:30:55 +02:00
parent 6d0f8bf145
commit 4be6bcae74
3 changed files with 12 additions and 14 deletions

View File

@@ -157,10 +157,7 @@ public abstract class MethodMatchers {
@Override
public int hashCode() {
int hashCode = 17;
hashCode = 37 * hashCode + this.mm1.hashCode();
hashCode = 37 * hashCode + this.mm2.hashCode();
return hashCode;
return 37 * this.mm1.hashCode() + this.mm2.hashCode();
}
}
@@ -209,6 +206,12 @@ public abstract class MethodMatchers {
}
return (this.cf1.equals(otherCf1) && this.cf2.equals(otherCf2));
}
@Override
public int hashCode() {
// Allow for matching with regular UnionMethodMatcher by providing same hash...
return super.hashCode();
}
}
@@ -271,10 +274,7 @@ public abstract class MethodMatchers {
@Override
public int hashCode() {
int hashCode = 17;
hashCode = 37 * hashCode + this.mm1.hashCode();
hashCode = 37 * hashCode + this.mm2.hashCode();
return hashCode;
return 37 * this.mm1.hashCode() + this.mm2.hashCode();
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -352,7 +352,6 @@ public class DependencyDescriptor extends InjectionPoint implements Serializable
Type[] args = ((ParameterizedType) type).getActualTypeArguments();
type = args[args.length - 1];
}
// TODO: Object.class if unresolvable
}
if (type instanceof Class) {
return (Class<?>) type;

View File

@@ -87,7 +87,7 @@ public class ResourceUrlProvider implements ApplicationListener<ContextRefreshed
public void onApplicationEvent(ContextRefreshedEvent event) {
if (this.handlerMap.isEmpty()) {
detectResourceHandlers(event.getApplicationContext());
if(logger.isDebugEnabled()) {
if (logger.isDebugEnabled()) {
logger.debug("No resource handling mappings found");
}
}
@@ -132,6 +132,7 @@ public class ResourceUrlProvider implements ApplicationListener<ContextRefreshed
String lookupPath = uriString.substring(0, queryIndex);
String query = uriString.substring(queryIndex);
PathContainer parsedLookupPath = PathContainer.parsePath(lookupPath);
if (logger.isTraceEnabled()) {
logger.trace("Getting resource URL for lookup path \"" + lookupPath + "\"");
}
@@ -163,8 +164,7 @@ public class ResourceUrlProvider implements ApplicationListener<ContextRefreshed
int endIndex = lookupPath.elements().size() - path.elements().size();
PathContainer mapping = lookupPath.subPath(0, endIndex);
if (logger.isTraceEnabled()) {
logger.trace("Invoking ResourceResolverChain for URL pattern " +
"\"" + entry.getKey() + "\"");
logger.trace("Invoking ResourceResolverChain for URL pattern \"" + entry.getKey() + "\"");
}
ResourceWebHandler handler = entry.getValue();
List<ResourceResolver> resolvers = handler.getResourceResolvers();
@@ -176,7 +176,6 @@ public class ResourceUrlProvider implements ApplicationListener<ContextRefreshed
}
return mapping.value() + resolvedPath;
});
})
.orElse(Mono.empty());
}