Efficient type plus annotation comparisons during converter retrieval

Issue: SPR-14926
Issue: SPR-12926
This commit is contained in:
Juergen Hoeller
2016-11-30 22:22:44 +01:00
parent ac5933a7ac
commit f6b8b84df9
3 changed files with 71 additions and 40 deletions

View File

@@ -598,15 +598,16 @@ public class TypeDescriptorTests {
TypeDescriptor t12 = new TypeDescriptor(getClass().getField("mapField"));
assertEquals(t11, t12);
TypeDescriptor t13 = new TypeDescriptor(new MethodParameter(getClass().getMethod("testAnnotatedMethod", String.class), 0));
TypeDescriptor t14 = new TypeDescriptor(new MethodParameter(getClass().getMethod("testAnnotatedMethod", String.class), 0));
MethodParameter testAnnotatedMethod = new MethodParameter(getClass().getMethod("testAnnotatedMethod", String.class), 0);
TypeDescriptor t13 = new TypeDescriptor(testAnnotatedMethod);
TypeDescriptor t14 = new TypeDescriptor(testAnnotatedMethod);
assertEquals(t13, t14);
TypeDescriptor t15 = new TypeDescriptor(new MethodParameter(getClass().getMethod("testAnnotatedMethod", String.class), 0));
TypeDescriptor t15 = new TypeDescriptor(testAnnotatedMethod);
TypeDescriptor t16 = new TypeDescriptor(new MethodParameter(getClass().getMethod("testAnnotatedMethodDifferentAnnotationValue", String.class), 0));
assertNotEquals(t15, t16);
TypeDescriptor t17 = new TypeDescriptor(new MethodParameter(getClass().getMethod("testAnnotatedMethod", String.class), 0));
TypeDescriptor t17 = new TypeDescriptor(testAnnotatedMethod);
TypeDescriptor t18 = new TypeDescriptor(new MethodParameter(getClass().getMethod("test5", String.class), 0));
assertNotEquals(t17, t18);
}