aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAndy Clement <aclement@pivotal.io>2016-11-07 16:18:54 -0800
committerAndy Clement <aclement@pivotal.io>2016-11-07 16:18:54 -0800
commit611e04a9e1f3f2368f3ce3237b6288b119ac9943 (patch)
tree8664f783ff4eae5ba78e6c356b2f3a9c3c800825 /tests
parentde34df77ea7f7372894cf1e2352766118a798e98 (diff)
downloadaspectj-611e04a9e1f3f2368f3ce3237b6288b119ac9943.tar.gz
aspectj-611e04a9e1f3f2368f3ce3237b6288b119ac9943.zip
Fix 500796: Allow for kotlin creating 'synthetic' local variable table entries
Diffstat (limited to 'tests')
-rw-r--r--tests/src/org/aspectj/systemtest/ajc150/AnnotationBinding.java7
-rw-r--r--tests/src/org/aspectj/systemtest/ajc150/GenericITDsDesign.java13
-rw-r--r--tests/src/org/aspectj/systemtest/ajc150/GenericsTests.java12
-rw-r--r--tests/src/org/aspectj/systemtest/ajc160/SanityTests.java1
-rw-r--r--tests/src/org/aspectj/systemtest/ajc1610/NewFeatures.java1
-rw-r--r--tests/src/org/aspectj/systemtest/ajc163/Ajc163Tests.java6
6 files changed, 20 insertions, 20 deletions
diff --git a/tests/src/org/aspectj/systemtest/ajc150/AnnotationBinding.java b/tests/src/org/aspectj/systemtest/ajc150/AnnotationBinding.java
index 63cebdb06..466567641 100644
--- a/tests/src/org/aspectj/systemtest/ajc150/AnnotationBinding.java
+++ b/tests/src/org/aspectj/systemtest/ajc150/AnnotationBinding.java
@@ -18,6 +18,7 @@ import junit.framework.Test;
import org.aspectj.asm.AsmManager;
import org.aspectj.asm.IHierarchy;
import org.aspectj.asm.IProgramElement;
+import org.aspectj.asm.IRelationship;
import org.aspectj.asm.internal.Relationship;
import org.aspectj.testing.XMLBasedAjcTestCase;
@@ -313,7 +314,7 @@ public class AnnotationBinding extends XMLBasedAjcTestCase {
"declare @method: int A.m() : @Fruit(\"orange\")");
assertTrue("Couldn't find 'declare @method' element in the tree", ipe != null);
- List l = asm.getRelationshipMap().get(ipe);
+ List<IRelationship> l = asm.getRelationshipMap().get(ipe);
assertTrue("Should have a relationship but does not ", l.size() > 0);
ipe = top.findElementForLabel(top.getRoot(), IProgramElement.Kind.DECLARE_ANNOTATION_AT_METHOD,
@@ -343,7 +344,7 @@ public class AnnotationBinding extends XMLBasedAjcTestCase {
"declare @field: int A.i : @Fruit(\"orange\")");
assertTrue("Couldn't find 'declare @type' element in the tree", ipe != null);
- List l = asm.getRelationshipMap().get(ipe);
+ List<IRelationship> l = asm.getRelationshipMap().get(ipe);
assertTrue("Should have a relationship but does not ", l.size() > 0);
ipe = top.findElementForLabel(top.getRoot(), IProgramElement.Kind.DECLARE_ANNOTATION_AT_FIELD,
@@ -375,7 +376,7 @@ public class AnnotationBinding extends XMLBasedAjcTestCase {
"declare @constructor: A.new(java.lang.String) : @Fruit(\"pear\")");
assertTrue("Couldn't find 'declare @constructor' element in the tree", ipe != null);
- List l = asm.getRelationshipMap().get(ipe);
+ List<IRelationship> l = asm.getRelationshipMap().get(ipe);
assertTrue("Should have a relationship but does not ", l.size() > 0);
ipe = top.findElementForLabel(top.getRoot(), IProgramElement.Kind.DECLARE_ANNOTATION_AT_CONSTRUCTOR,
diff --git a/tests/src/org/aspectj/systemtest/ajc150/GenericITDsDesign.java b/tests/src/org/aspectj/systemtest/ajc150/GenericITDsDesign.java
index dfedf65a0..6209298c1 100644
--- a/tests/src/org/aspectj/systemtest/ajc150/GenericITDsDesign.java
+++ b/tests/src/org/aspectj/systemtest/ajc150/GenericITDsDesign.java
@@ -15,6 +15,7 @@ import org.aspectj.apache.bcel.util.ClassPath;
import org.aspectj.apache.bcel.util.SyntheticRepository;
import org.aspectj.testing.XMLBasedAjcTestCase;
import org.aspectj.tools.ajc.Ajc;
+import org.aspectj.weaver.ConcreteTypeMunger;
import org.aspectj.weaver.CrosscuttingMembers;
import org.aspectj.weaver.ReferenceType;
import org.aspectj.weaver.ResolvedMember;
@@ -75,12 +76,12 @@ public class GenericITDsDesign extends XMLBasedAjcTestCase {
.equals(sig));
}
- public List /* BcelTypeMunger */getTypeMunger(String classname) {
+ public List<ConcreteTypeMunger> getTypeMunger(String classname) {
ClassPath cp = new ClassPath(ajc.getSandboxDirectory() + File.pathSeparator + System.getProperty("java.class.path"));
recentWorld = new BcelWorld(cp.toString());
ReferenceType resolvedType = (ReferenceType) recentWorld.resolve(classname);
CrosscuttingMembers cmembers = resolvedType.collectCrosscuttingMembers(true);
- List tmungers = cmembers.getTypeMungers();
+ List<ConcreteTypeMunger> tmungers = cmembers.getTypeMungers();
return tmungers;
}
@@ -100,9 +101,9 @@ public class GenericITDsDesign extends XMLBasedAjcTestCase {
return null;
}
- public Hashtable getMeTheFields(String classname) {
+ public Hashtable<String,Field> getMeTheFields(String classname) {
JavaClass theClass = getClassFromDisk(ajc, classname);
- Hashtable retval = new Hashtable();
+ Hashtable<String,Field> retval = new Hashtable<>();
org.aspectj.apache.bcel.classfile.Field[] fs = theClass.getFields();
for (int i = 0; i < fs.length; i++) {
Field field = fs[i];
@@ -206,7 +207,7 @@ public class GenericITDsDesign extends XMLBasedAjcTestCase {
// Verifying what gets into a class targetted with a field ITD
public void testDesignF() {
runTest("generic itds - design F");
- Hashtable fields = getMeTheFields("C");
+ Hashtable<String,Field> fields = getMeTheFields("C");
// Declared in src as: List C.list1; and List<Z> C<Z>.list2;
Field list1 = (Field) fields.get("list1");// ajc$interField$$list1");
@@ -229,7 +230,7 @@ public class GenericITDsDesign extends XMLBasedAjcTestCase {
// Verifying what gets into a class when an interface it implements was targetted with a field ITD
public void testDesignG() {
runTest("generic itds - design G");
- Hashtable fields = getMeTheFields("C");
+ Hashtable<String,Field> fields = getMeTheFields("C");
// The ITDs are targetting an interface. That interface is generic and is parameterized with
// 'String' when implemented in the class C. This means the fields that make it into C should
diff --git a/tests/src/org/aspectj/systemtest/ajc150/GenericsTests.java b/tests/src/org/aspectj/systemtest/ajc150/GenericsTests.java
index 21efa3328..1ec2b21c1 100644
--- a/tests/src/org/aspectj/systemtest/ajc150/GenericsTests.java
+++ b/tests/src/org/aspectj/systemtest/ajc150/GenericsTests.java
@@ -875,11 +875,11 @@ public class GenericsTests extends XMLBasedAjcTestCase {
* bridge methods have been created.
*/
public void checkMethodsExist(String classname,String[] methods) {
- Set methodsFound = new HashSet();
+ Set<String> methodsFound = new HashSet<>();
StringBuffer debugString = new StringBuffer();
try {
ClassLoader cl = new URLClassLoader(new URL[]{ajc.getSandboxDirectory().toURL()});
- Class clz = Class.forName(classname,false,cl);
+ Class<?> clz = Class.forName(classname,false,cl);
java.lang.reflect.Method[] ms = clz.getDeclaredMethods();
if (ms!=null) {
for (int i =0;i<ms.length;i++) {
@@ -905,8 +905,7 @@ public class GenericsTests extends XMLBasedAjcTestCase {
}
StringBuffer unexpectedMethods = new StringBuffer();
if (!methodsFound.isEmpty()) {
- for (Iterator iter = methodsFound.iterator(); iter.hasNext();) {
- String element = (String) iter.next();
+ for (String element: methodsFound) {
unexpectedMethods.append("[").append(element).append("]");
}
fail("These methods weren't expected: "+unexpectedMethods);
@@ -924,7 +923,7 @@ public class GenericsTests extends XMLBasedAjcTestCase {
return false;
}
try {
- final Class[] noparms = new Class[0];
+ final Class<?>[] noparms = new Class[0];
java.lang.reflect.Method isBridge
= java.lang.reflect.Method.class.getMethod("isBridge", noparms);
Boolean result = (Boolean) isBridge.invoke(m, new Object[0]);
@@ -959,7 +958,6 @@ public class GenericsTests extends XMLBasedAjcTestCase {
public static void checkOneSignatureAttribute(Ajc ajc,String classname) {
JavaClass clazz = getClass(ajc,classname);
- Signature sigAttr = null;
Attribute[] attrs = clazz.getAttributes();
int signatureCount = 0;
StringBuffer sb = new StringBuffer();
@@ -981,7 +979,7 @@ public class GenericsTests extends XMLBasedAjcTestCase {
sigAttr.getSignature().equals(sig));
}
- private static String stringify(Class[] clazzes) {
+ private static String stringify(Class<?>[] clazzes) {
if (clazzes==null) return "";
StringBuffer sb = new StringBuffer();
for (int i = 0; i < clazzes.length; i++) {
diff --git a/tests/src/org/aspectj/systemtest/ajc160/SanityTests.java b/tests/src/org/aspectj/systemtest/ajc160/SanityTests.java
index 5d0462c99..45eac49ce 100644
--- a/tests/src/org/aspectj/systemtest/ajc160/SanityTests.java
+++ b/tests/src/org/aspectj/systemtest/ajc160/SanityTests.java
@@ -94,6 +94,7 @@ public class SanityTests extends org.aspectj.testing.XMLBasedAjcTestCase {
// }
/* For the specified class, check that each method has a stackmap attribute */
+ @SuppressWarnings("unused")
private void checkStackMapExistence(String classname, String toIgnore) throws ClassNotFoundException {
toIgnore = "_" + (toIgnore == null ? "" : toIgnore) + "_";
JavaClass jc = getClassFrom(ajc.getSandboxDirectory(), classname);
diff --git a/tests/src/org/aspectj/systemtest/ajc1610/NewFeatures.java b/tests/src/org/aspectj/systemtest/ajc1610/NewFeatures.java
index b9de3dff7..588d71186 100644
--- a/tests/src/org/aspectj/systemtest/ajc1610/NewFeatures.java
+++ b/tests/src/org/aspectj/systemtest/ajc1610/NewFeatures.java
@@ -31,6 +31,7 @@ public class NewFeatures extends org.aspectj.testing.XMLBasedAjcTestCase {
}
}
+ @SuppressWarnings("unused")
public void testMakeSJPOptimizationCollapsedSJPYes14() {
this.runTest("makeSJP optimization - Collapsed SJP - Yes 1.4");
try {
diff --git a/tests/src/org/aspectj/systemtest/ajc163/Ajc163Tests.java b/tests/src/org/aspectj/systemtest/ajc163/Ajc163Tests.java
index 224f695ef..15abc8921 100644
--- a/tests/src/org/aspectj/systemtest/ajc163/Ajc163Tests.java
+++ b/tests/src/org/aspectj/systemtest/ajc163/Ajc163Tests.java
@@ -11,7 +11,6 @@
package org.aspectj.systemtest.ajc163;
import java.io.File;
-import java.util.Iterator;
import java.util.List;
import junit.framework.Test;
@@ -174,9 +173,8 @@ public class Ajc163Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
if (whereToLook.getSourceLocation() != null && whereToLook.getSourceLocation().getLine() == line) {
return whereToLook;
}
- List kids = whereToLook.getChildren();
- for (Iterator iterator = kids.iterator(); iterator.hasNext();) {
- IProgramElement object = (IProgramElement) iterator.next();
+ List<IProgramElement> kids = whereToLook.getChildren();
+ for (IProgramElement object: kids) {
if (object.getSourceLocation() != null && object.getSourceLocation().getLine() == line) {
return object;
}