Browse Source

Polishing

pull/1884/head
Juergen Hoeller 8 years ago
parent
commit
4be6bcae74
  1. 16
      spring-aop/src/main/java/org/springframework/aop/support/MethodMatchers.java
  2. 3
      spring-beans/src/main/java/org/springframework/beans/factory/config/DependencyDescriptor.java
  3. 7
      spring-webflux/src/main/java/org/springframework/web/reactive/resource/ResourceUrlProvider.java

16
spring-aop/src/main/java/org/springframework/aop/support/MethodMatchers.java

@ -157,10 +157,7 @@ public abstract class MethodMatchers { @@ -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 { @@ -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 { @@ -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();
}
}

3
spring-beans/src/main/java/org/springframework/beans/factory/config/DependencyDescriptor.java

@ -1,5 +1,5 @@ @@ -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 @@ -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;

7
spring-webflux/src/main/java/org/springframework/web/reactive/resource/ResourceUrlProvider.java

@ -87,7 +87,7 @@ public class ResourceUrlProvider implements ApplicationListener<ContextRefreshed @@ -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 @@ -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 @@ -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 @@ -176,7 +176,6 @@ public class ResourceUrlProvider implements ApplicationListener<ContextRefreshed
}
return mapping.value() + resolvedPath;
});
})
.orElse(Mono.empty());
}

Loading…
Cancel
Save