From 7e0b21d1326d5180ba64cfe4b0b3c440e5fd55d8 Mon Sep 17 00:00:00 2001 From: Andy Clement Date: Wed, 22 Apr 2020 11:02:57 -0700 Subject: [PATCH] Polish --- ...lectionBasedReferenceTypeDelegateTest.java | 3 +- .../JoinPointSignatureIteratorTest.java | 28 +++++++++---------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/weaver/src/test/java/org/aspectj/weaver/Java5ReflectionBasedReferenceTypeDelegateTest.java b/weaver/src/test/java/org/aspectj/weaver/Java5ReflectionBasedReferenceTypeDelegateTest.java index cc9a895d0..b1f5df571 100644 --- a/weaver/src/test/java/org/aspectj/weaver/Java5ReflectionBasedReferenceTypeDelegateTest.java +++ b/weaver/src/test/java/org/aspectj/weaver/Java5ReflectionBasedReferenceTypeDelegateTest.java @@ -66,7 +66,7 @@ public class Java5ReflectionBasedReferenceTypeDelegateTest extends ReflectionBas ReferenceType rawType = (ReferenceType) world.resolve(javaUtilMap); assertTrue("Should be the raw type ?!? " + rawType.getTypekind(), rawType.isRawType()); - ReferenceType genericType = (ReferenceType) rawType.getGenericType(); + ReferenceType genericType = rawType.getGenericType(); assertTrue("Should be the generic type ?!? " + genericType.getTypekind(), genericType.isGenericType()); ResolvedType rt = rawType.getSuperclass(); @@ -83,7 +83,6 @@ public class Java5ReflectionBasedReferenceTypeDelegateTest extends ReflectionBas public void testAnnotationFinderClassRetention() throws Exception { ResolvedType type = world.resolve(AnnoTesting.class.getName()); ResolvedMember[] ms = type.getDeclaredMethods(); - int findMethod = findMethod("a", ms); ResolvedMember methodWithOnlyClassLevelAnnotation = ms[findMethod("a", ms)]; ResolvedMember methodWithOnlyRuntimeLevelAnnotation = ms[findMethod("b", ms)]; diff --git a/weaver/src/test/java/org/aspectj/weaver/JoinPointSignatureIteratorTest.java b/weaver/src/test/java/org/aspectj/weaver/JoinPointSignatureIteratorTest.java index 30d653b89..ad384fa49 100644 --- a/weaver/src/test/java/org/aspectj/weaver/JoinPointSignatureIteratorTest.java +++ b/weaver/src/test/java/org/aspectj/weaver/JoinPointSignatureIteratorTest.java @@ -1,12 +1,12 @@ /* ******************************************************************* * Copyright (c) 2009 Contributors. - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html - * - * Contributors: + * All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution and is available at + * http://eclipse.org/legal/epl-v10.html + * + * Contributors: * Andy Clement * ******************************************************************/ package org.aspectj.weaver; @@ -52,7 +52,7 @@ public class JoinPointSignatureIteratorTest extends TestCase { if (expectedResults.containsKey(rm.toString())) { System.out.println("\nChecking: " + rm); int i = 0; - List/* String */sigs = (List) expectedResults.get(rm.toString()); + List sigs = expectedResults.get(rm.toString()); Iterator jpsi = rm.getJoinPointSignatures(w); while (jpsi.hasNext()) { ResolvedMember sig = (ResolvedMember) jpsi.next(); @@ -75,32 +75,32 @@ public class JoinPointSignatureIteratorTest extends TestCase { } } - public static Map expectedResults = new HashMap(); + public static Map> expectedResults = new HashMap<>(); static { - List sigs = new ArrayList(); + List sigs = new ArrayList(); sigs.add("java.lang.Object $Proxy1.get1(java.io.Serializable)"); sigs.add("java.lang.Object MessageService.get1(java.io.Serializable)"); sigs.add("java.lang.Object GenericService.get1(java.io.Serializable)"); sigs.add("java.lang.Object GenericService.get1(java.io.Serializable)"); expectedResults.put("java.lang.Object $Proxy1.get1(java.io.Serializable)", sigs); - sigs = new ArrayList(); + sigs = new ArrayList(); sigs.add("java.lang.Object $Proxy1.get2(java.io.Serializable)"); sigs.add("java.lang.Object MessageService.get2(java.io.Serializable)"); sigs.add("java.lang.Object GenericService.get2(java.io.Serializable)"); sigs.add("java.lang.Object GenericService.get2(java.io.Serializable)"); expectedResults.put("java.lang.Object $Proxy1.get2(java.io.Serializable)", sigs); - sigs = new ArrayList(); + sigs = new ArrayList(); sigs.add("java.lang.Object $Proxy1.get1(java.lang.Long)"); expectedResults.put("java.lang.Object $Proxy1.get1(java.lang.Long)", sigs); - sigs = new ArrayList(); + sigs = new ArrayList(); sigs.add("java.lang.Object GenericService.get1(java.io.Serializable)"); expectedResults.put("java.lang.Object GenericService.get1(java.io.Serializable)", sigs); - sigs = new ArrayList(); + sigs = new ArrayList(); sigs.add("java.lang.Object GenericService.get2(java.io.Serializable)"); expectedResults.put("java.lang.Object GenericService.get2(java.io.Serializable)", sigs); } -- 2.39.5