diff --git a/byte-buddy-dep/src/test/java/net/bytebuddy/description/type/TypeDescriptionArrayProjectionTest.java b/byte-buddy-dep/src/test/java/net/bytebuddy/description/type/TypeDescriptionArrayProjectionTest.java index 816197fe00..dbc744f08d 100644 --- a/byte-buddy-dep/src/test/java/net/bytebuddy/description/type/TypeDescriptionArrayProjectionTest.java +++ b/byte-buddy-dep/src/test/java/net/bytebuddy/description/type/TypeDescriptionArrayProjectionTest.java @@ -38,15 +38,13 @@ protected TypeDescription.Generic describeParameterType(Method method, int index } protected TypeDescription.Generic describeExceptionType(Method method, int index) { - Type[] genericExceptionTypes = method.getGenericExceptionTypes(); - Arrays.sort(genericExceptionTypes, new Comparator() { - @Override - public int compare(Type type, Type t1) { - return type.getTypeName().compareTo(t1.getTypeName()); + Type[] type = method.getGenericExceptionTypes(); + Arrays.sort(type, new Comparator() { + public int compare(Type left, Type right) { + return left.getTypeName().compareTo(right.getTypeName()); } }); - - return TypeDefinition.Sort.describe(genericExceptionTypes[index], + return TypeDefinition.Sort.describe(type[index], new TypeDescription.Generic.AnnotationReader.Delegator.ForLoadedExecutableExceptionType(method, index)); } diff --git a/byte-buddy-dep/src/test/java/net/bytebuddy/description/type/TypeDescriptionGenericBuilderTest.java b/byte-buddy-dep/src/test/java/net/bytebuddy/description/type/TypeDescriptionGenericBuilderTest.java index aee30fac79..7d9014dd93 100644 --- a/byte-buddy-dep/src/test/java/net/bytebuddy/description/type/TypeDescriptionGenericBuilderTest.java +++ b/byte-buddy-dep/src/test/java/net/bytebuddy/description/type/TypeDescriptionGenericBuilderTest.java @@ -42,15 +42,13 @@ protected TypeDescription.Generic describeParameterType(Method method, int index } protected TypeDescription.Generic describeExceptionType(Method method, int index) { - Type[] genericExceptionTypes = method.getGenericExceptionTypes(); - Arrays.sort(genericExceptionTypes, new Comparator() { - @Override - public int compare(Type type, Type t1) { - return type.getTypeName().compareTo(t1.getTypeName()); + Type[] type = method.getGenericExceptionTypes(); + Arrays.sort(type, new Comparator() { + public int compare(Type left, Type right) { + return left.getTypeName().compareTo(right.getTypeName()); } }); - - return describe(genericExceptionTypes[index], new TypeDescription.Generic.AnnotationReader.Delegator.ForLoadedExecutableExceptionType(method, index)) + return describe(type[index], new TypeDescription.Generic.AnnotationReader.Delegator.ForLoadedExecutableExceptionType(method, index)) .accept(TypeDescription.Generic.Visitor.Substitutor.ForAttachment.of(new MethodDescription.ForLoadedMethod(method))); } diff --git a/byte-buddy-dep/src/test/java/net/bytebuddy/implementation/auxiliary/MethodCallProxyTest.java b/byte-buddy-dep/src/test/java/net/bytebuddy/implementation/auxiliary/MethodCallProxyTest.java index 0058b02a5f..f5daf62bf1 100644 --- a/byte-buddy-dep/src/test/java/net/bytebuddy/implementation/auxiliary/MethodCallProxyTest.java +++ b/byte-buddy-dep/src/test/java/net/bytebuddy/implementation/auxiliary/MethodCallProxyTest.java @@ -84,15 +84,14 @@ public void testNonGenericParameter() throws Exception { Class auxiliaryType = proxyOnlyDeclaredMethodOf(GenericType.class); assertThat(auxiliaryType.getTypeParameters().length, is(0)); assertThat(auxiliaryType.getDeclaredMethod("call").getGenericReturnType(), is((Type) Object.class)); - Field[] declaredFields = auxiliaryType.getDeclaredFields(); - Arrays.sort(declaredFields, new Comparator() { - @Override - public int compare(Field field1, Field field2) { - return field1.getName().compareTo(field2.getName()); + Field[] field = auxiliaryType.getDeclaredFields(); + Arrays.sort(field, new Comparator() { + public int compare(Field left, Field right) { + return left.getName().compareTo(right.getName()); } }); - assertThat(declaredFields[1].getGenericType(), is((Type) Object.class)); - assertThat(declaredFields[2].getGenericType(), is((Type) Number.class)); + assertThat(field[1].getGenericType(), is((Type) Object.class)); + assertThat(field[2].getGenericType(), is((Type) Number.class)); } @Test