Polishing
This commit is contained in:
parent
46a790f9be
commit
0b118322b0
|
@ -60,8 +60,7 @@ public abstract class AbstractApplicationEventMulticaster
|
|||
|
||||
private final ListenerRetriever defaultRetriever = new ListenerRetriever(false);
|
||||
|
||||
final Map<ListenerCacheKey, ListenerRetriever> retrieverCache =
|
||||
new ConcurrentHashMap<>(64);
|
||||
final Map<ListenerCacheKey, ListenerRetriever> retrieverCache = new ConcurrentHashMap<>(64);
|
||||
|
||||
private ClassLoader beanClassLoader;
|
||||
|
||||
|
|
|
@ -139,40 +139,35 @@ public class GenericTypeResolverTests {
|
|||
assertThat(x, equalTo((Type) Long.class));
|
||||
}
|
||||
|
||||
@Test
|
||||
@Test // SPR-11030
|
||||
public void getGenericsCannotBeResolved() throws Exception {
|
||||
// SPR-11030
|
||||
Class<?>[] resolved = GenericTypeResolver.resolveTypeArguments(List.class, Iterable.class);
|
||||
assertNull(resolved);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Test // SPR-11052
|
||||
public void getRawMapTypeCannotBeResolved() throws Exception {
|
||||
// SPR-11052
|
||||
Class<?>[] resolved = GenericTypeResolver.resolveTypeArguments(Map.class, Map.class);
|
||||
assertNull(resolved);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Test // SPR-11044
|
||||
public void getGenericsOnArrayFromParamCannotBeResolved() throws Exception {
|
||||
// SPR-11044
|
||||
MethodParameter methodParameter = MethodParameter.forExecutable(
|
||||
WithArrayBase.class.getDeclaredMethod("array", Object[].class), 0);
|
||||
Class<?> resolved = GenericTypeResolver.resolveParameterType(methodParameter, WithArray.class);
|
||||
assertThat(resolved, equalTo((Class<?>) Object[].class));
|
||||
}
|
||||
|
||||
@Test
|
||||
@Test // SPR-11044
|
||||
public void getGenericsOnArrayFromReturnCannotBeResolved() throws Exception {
|
||||
// SPR-11044
|
||||
Class<?> resolved = GenericTypeResolver.resolveReturnType(
|
||||
WithArrayBase.class.getDeclaredMethod("array", Object[].class), WithArray.class);
|
||||
assertThat(resolved, equalTo((Class<?>) Object[].class));
|
||||
}
|
||||
|
||||
@Test
|
||||
@Test // SPR-11763
|
||||
public void resolveIncompleteTypeVariables() {
|
||||
// SPR-11763
|
||||
Class<?>[] resolved = GenericTypeResolver.resolveTypeArguments(IdFixingRepository.class, Repository.class);
|
||||
assertNotNull(resolved);
|
||||
assertEquals(2, resolved.length);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2016 the original author or authors.
|
||||
* Copyright 2002-2017 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.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2016 the original author or authors.
|
||||
* Copyright 2002-2017 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.
|
||||
|
|
|
@ -71,6 +71,7 @@ public class ForwardedHeaderFilter extends OncePerRequestFilter {
|
|||
|
||||
private final UrlPathHelper pathHelper;
|
||||
|
||||
|
||||
public ForwardedHeaderFilter() {
|
||||
this.pathHelper = new UrlPathHelper();
|
||||
this.pathHelper.setUrlDecode(false);
|
||||
|
|
|
@ -249,13 +249,10 @@ public class ServletInvocableHandlerMethod extends InvocableHandlerMethod {
|
|||
public ConcurrentResultMethodParameter(Object returnValue) {
|
||||
super(-1);
|
||||
this.returnValue = returnValue;
|
||||
|
||||
ResolvableType candidateReturnType =
|
||||
ResolvableType.forType(super.getGenericParameterType()).getGeneric(0);
|
||||
|
||||
this.returnType = returnValue instanceof ReactiveTypeHandler.CollectedValuesList ?
|
||||
ResolvableType.forClassWithGenerics(List.class, candidateReturnType) :
|
||||
candidateReturnType;
|
||||
this.returnType = (returnValue instanceof ReactiveTypeHandler.CollectedValuesList ?
|
||||
ResolvableType.forClassWithGenerics(List.class, candidateReturnType) : candidateReturnType);
|
||||
}
|
||||
|
||||
public ConcurrentResultMethodParameter(ConcurrentResultMethodParameter original) {
|
||||
|
|
Loading…
Reference in New Issue