aboutsummaryrefslogtreecommitdiffstats
path: root/weaver/src
diff options
context:
space:
mode:
authorAndy Clement <aclement@pivotal.io>2020-08-16 11:31:18 -0700
committerAndy Clement <aclement@pivotal.io>2020-08-16 11:31:18 -0700
commite0adab7d8f01c38ef2650a9f726be4ac853ee721 (patch)
treede4823c0fe628530c2867e476718830a85fa8b26 /weaver/src
parent4a2ecf60ebaa4a5ad097da45ef912e1af3cd0dce (diff)
downloadaspectj-e0adab7d8f01c38ef2650a9f726be4ac853ee721.tar.gz
aspectj-e0adab7d8f01c38ef2650a9f726be4ac853ee721.zip
polish
Diffstat (limited to 'weaver/src')
-rw-r--r--weaver/src/test/java/org/aspectj/weaver/ReferenceTypeTestCase.java41
-rw-r--r--weaver/src/test/java/org/aspectj/weaver/bcel/PointcutResidueTestCase.java21
-rw-r--r--weaver/src/test/java/org/aspectj/weaver/tools/PointcutParserTest.java14
3 files changed, 38 insertions, 38 deletions
diff --git a/weaver/src/test/java/org/aspectj/weaver/ReferenceTypeTestCase.java b/weaver/src/test/java/org/aspectj/weaver/ReferenceTypeTestCase.java
index fbe505292..bae13be9e 100644
--- a/weaver/src/test/java/org/aspectj/weaver/ReferenceTypeTestCase.java
+++ b/weaver/src/test/java/org/aspectj/weaver/ReferenceTypeTestCase.java
@@ -1,12 +1,12 @@
/* *******************************************************************
* Copyright (c) 2005 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:
* Adrian Colyer Initial implementation
* ******************************************************************/
package org.aspectj.weaver;
@@ -23,6 +23,7 @@ import junit.framework.TestCase;
// test cases for Adrian's additions to ReferenceType
// XXX - couldn't find any unit test cases for the rest of the ReferenceType class
+@SuppressWarnings({ "unused", "rawtypes", "unchecked" })
public class ReferenceTypeTestCase extends TestCase {
public void testIsRawTrue() {
@@ -244,7 +245,7 @@ public class ReferenceTypeTestCase extends TestCase {
assertTrue(ajListOfSomethingNumberish.isAssignableFrom(ajListOfInteger));
// void around(): execution(* C.m1(..)) && args(ArrayList<? extends Number>){}// Should runtime check (it does!)
- arrayListOfSomethingNumberish = (ArrayList<? extends Number>) listOfInteger;
+ arrayListOfSomethingNumberish = listOfInteger;
assertFalse(ajArrayListOfSomethingNumberish.isAssignableFrom(ajListOfInteger));
assertTrue(ajArrayListOfSomethingNumberish.isCoerceableFrom(ajListOfInteger));
@@ -253,7 +254,7 @@ public class ReferenceTypeTestCase extends TestCase {
assertTrue(ajList.isAssignableFrom(ajListOfInteger));
// void around(): execution(* C.m1(..)) && args(ArrayList){}//: Should runtime check (it does not match!)
- arraylist = (ArrayList) listOfInteger;
+ arraylist = listOfInteger;
assertFalse(ajArrayList.isAssignableFrom(ajListOfInteger));
assertTrue(ajArrayList.isCoerceableFrom(ajListOfInteger));
@@ -262,7 +263,7 @@ public class ReferenceTypeTestCase extends TestCase {
assertTrue(ajListOfSomething.isAssignableFrom(ajListOfInteger));
// void around(): execution(* C.m1(..)) && args(ArrayList<?>){}// Should runtime check (it does not match!)
- arrayListOfSomething = (ArrayList<?>) listOfInteger;
+ arrayListOfSomething = listOfInteger;
assertFalse(ajArrayListOfSomething.isAssignableFrom(ajListOfInteger));
assertTrue(ajArrayListOfSomething.isCoerceableFrom(ajListOfInteger));
@@ -331,7 +332,7 @@ public class ReferenceTypeTestCase extends TestCase {
assertTrue(ajListOfSomethingNumberish.isAssignableFrom(ajListOfSomethingNumberish));
// void around(): execution(* C.m2(..)) && args(ArrayList<? extends Number>){}//: Should runtime check (it does!)
- arrayListOfSomethingNumberish = (ArrayList<? extends Number>) listOfSomethingNumberish;
+ arrayListOfSomethingNumberish = listOfSomethingNumberish;
assertFalse(ajArrayListOfSomethingNumberish.isAssignableFrom(ajListOfSomethingNumberish));
assertTrue(ajArrayListOfSomethingNumberish.isCoerceableFrom(ajListOfSomethingNumberish));
@@ -340,7 +341,7 @@ public class ReferenceTypeTestCase extends TestCase {
assertTrue(ajList.isAssignableFrom(ajListOfSomethingNumberish));
// void around(): execution(* C.m2(..)) && args(ArrayList){}//: Should runtime check (it does not match!) ERROR
- arraylist = (ArrayList) listOfSomethingNumberish;
+ arraylist = listOfSomethingNumberish;
assertFalse(ajArrayList.isAssignableFrom(ajListOfSomethingNumberish));
assertTrue(ajArrayList.isCoerceableFrom(ajListOfSomethingNumberish));
@@ -349,7 +350,7 @@ public class ReferenceTypeTestCase extends TestCase {
assertTrue(ajListOfSomething.isAssignableFrom(ajListOfSomethingNumberish));
// void around(): execution(* C.m2(..)) && args(ArrayList<?>){}//: Should runtime check (it does!)
- arrayListOfSomething = (ArrayList) listOfSomethingNumberish;
+ arrayListOfSomething = listOfSomethingNumberish;
assertFalse(ajArrayListOfSomething.isAssignableFrom(ajListOfSomethingNumberish));
assertTrue(ajArrayListOfSomething.isCoerceableFrom(ajListOfSomethingNumberish));
@@ -408,7 +409,7 @@ public class ReferenceTypeTestCase extends TestCase {
assertTrue(ajListOfNumber.isAssignableFrom(ajListOfNumber));
// void around(): execution(* C.m3(..)) && args(ArrayList<Number>){}//: Should runtime match (it does)
- arrayListOfNumber = (ArrayList<Number>) listOfNumber;
+ arrayListOfNumber = listOfNumber;
assertFalse(ajArrayListOfNumber.isAssignableFrom(ajListOfNumber));
assertTrue(ajArrayListOfNumber.isCoerceableFrom(ajListOfNumber));
@@ -417,7 +418,7 @@ public class ReferenceTypeTestCase extends TestCase {
assertTrue(ajListOfSomethingNumberish.isAssignableFrom(ajListOfNumber));
// void around(): execution(* C.m3(..)) && args(ArrayList<? extends Number>){}//: Should runtime check (it does!)
- arrayListOfSomethingNumberish = (ArrayList<? extends Number>) listOfNumber;
+ arrayListOfSomethingNumberish = listOfNumber;
assertFalse(ajArrayListOfSomethingNumberish.isAssignableFrom(ajListOfNumber));
assertTrue(ajArrayListOfSomethingNumberish.isCoerceableFrom(ajListOfNumber));
@@ -426,7 +427,7 @@ public class ReferenceTypeTestCase extends TestCase {
assertTrue(ajList.isAssignableFrom(ajListOfNumber));
// void around(): execution(* C.m3(..)) && args(ArrayList){}//: Should runtime check (it does not match!) ERROR
- arrayList = (ArrayList) listOfNumber;
+ arrayList = listOfNumber;
assertFalse(ajArrayList.isAssignableFrom(ajListOfNumber));
assertTrue(ajArrayList.isCoerceableFrom(ajListOfNumber));
@@ -435,7 +436,7 @@ public class ReferenceTypeTestCase extends TestCase {
assertTrue(ajListOfSomething.isAssignableFrom(ajListOfNumber));
// void around(): execution(* C.m3(..)) && args(ArrayList<?>){}//: Should runtime check (it does!)
- arrayListOfSomething = (ArrayList<?>) listOfNumber;
+ arrayListOfSomething = listOfNumber;
assertFalse(ajArrayListOfSomething.isAssignableFrom(ajListOfNumber));
assertTrue(ajArrayListOfSomething.isCoerceableFrom(ajListOfNumber));
@@ -449,7 +450,7 @@ public class ReferenceTypeTestCase extends TestCase {
static class ClassA<T> {
}
- static interface IMarker<H> {
+ interface IMarker<H> {
}
static class ClassB<T> implements IMarker<ClassA<T>> {
@@ -542,7 +543,7 @@ public class ReferenceTypeTestCase extends TestCase {
assertTrue(ajList.isAssignableFrom(ajListOfSomething));
// void around(): execution(* C.m4(..)) && args(ArrayList){} // Should runtime check
- arraylist = (ArrayList) listOfSomething;
+ arraylist = listOfSomething;
assertFalse(ajArrayList.isAssignableFrom(ajListOfSomething));
assertTrue(ajArrayList.isCoerceableFrom(ajListOfSomething));
@@ -551,7 +552,7 @@ public class ReferenceTypeTestCase extends TestCase {
assertTrue(ajList.isAssignableFrom(ajListOfSomething));
// void around(): execution(* C.m4(..)) && args(ArrayList<?>){} // Should runtime check
- arrayListOfSomething = (ArrayList<?>) listOfSomething;
+ arrayListOfSomething = listOfSomething;
assertFalse(ajArrayListOfSomething.isAssignableFrom(ajListOfSomething));
assertTrue(ajArrayListOfSomething.isCoerceableFrom(ajListOfSomething));
diff --git a/weaver/src/test/java/org/aspectj/weaver/bcel/PointcutResidueTestCase.java b/weaver/src/test/java/org/aspectj/weaver/bcel/PointcutResidueTestCase.java
index 7f6f5f163..210002fa6 100644
--- a/weaver/src/test/java/org/aspectj/weaver/bcel/PointcutResidueTestCase.java
+++ b/weaver/src/test/java/org/aspectj/weaver/bcel/PointcutResidueTestCase.java
@@ -1,13 +1,13 @@
/* *******************************************************************
* Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC).
- * 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://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * PARC initial implementation
+ * 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://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * PARC initial implementation
* ******************************************************************/
package org.aspectj.weaver.bcel;
@@ -16,7 +16,7 @@ import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.lang.reflect.Modifier;
-import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
import org.aspectj.weaver.AdviceKind;
@@ -167,8 +167,7 @@ public class PointcutResidueTestCase extends WeaveTestCase {
}
public void weaveTest(String name, String outName, ShadowMunger planner) throws IOException {
- List l = new ArrayList(1);
- l.add(planner);
+ List<ShadowMunger> l = Collections.singletonList(planner);
weaveTest(name, outName, l);
}
diff --git a/weaver/src/test/java/org/aspectj/weaver/tools/PointcutParserTest.java b/weaver/src/test/java/org/aspectj/weaver/tools/PointcutParserTest.java
index cf10b3662..6e4ffa9f6 100644
--- a/weaver/src/test/java/org/aspectj/weaver/tools/PointcutParserTest.java
+++ b/weaver/src/test/java/org/aspectj/weaver/tools/PointcutParserTest.java
@@ -1,11 +1,11 @@
/* *******************************************************************
* Copyright (c) 2004 IBM Corporation.
- * 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://www.eclipse.org/legal/epl-v10.html
- *
+ * 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://www.eclipse.org/legal/epl-v10.html
+ *
* ******************************************************************/
package org.aspectj.weaver.tools;
@@ -199,7 +199,7 @@ public class PointcutParserTest extends TestCase {
return;
}
- Set pcKinds = PointcutParser.getAllSupportedPointcutPrimitives();
+ Set<PointcutPrimitive> pcKinds = PointcutParser.getAllSupportedPointcutPrimitives();
pcKinds.remove(PointcutPrimitive.REFERENCE);
PointcutParser p = PointcutParser.getPointcutParserSupportingSpecifiedPrimitivesAndUsingSpecifiedClassLoaderForResolution(
pcKinds, this.getClass().getClassLoader());