aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraclement <aclement>2005-12-15 10:36:22 +0000
committeraclement <aclement>2005-12-15 10:36:22 +0000
commit332eef9ebd79970f5ac2fe671c4e0efdce85974a (patch)
treec731562af46840ff911af84b3d19cfdaf5f18cde
parent2c59ee16ca8454b20f538e7ea8dde4e7b829fc7c (diff)
downloadaspectj-332eef9ebd79970f5ac2fe671c4e0efdce85974a.tar.gz
aspectj-332eef9ebd79970f5ac2fe671c4e0efdce85974a.zip
test updates and the fix for cases 3&4 in 120916: Jrockit test failures with RC1
-rw-r--r--tests/src/org/aspectj/systemtest/ajc150/GenericsTests.java18
-rw-r--r--weaver/src/org/aspectj/weaver/bcel/LazyClassGen.java4
2 files changed, 19 insertions, 3 deletions
diff --git a/tests/src/org/aspectj/systemtest/ajc150/GenericsTests.java b/tests/src/org/aspectj/systemtest/ajc150/GenericsTests.java
index 34ef3cc42..aad28e2a5 100644
--- a/tests/src/org/aspectj/systemtest/ajc150/GenericsTests.java
+++ b/tests/src/org/aspectj/systemtest/ajc150/GenericsTests.java
@@ -538,6 +538,7 @@ public class GenericsTests extends XMLBasedAjcTestCase {
public void testPR96220_GenericDecp() {
runTest("generic decp - simple");
+ checkOneSignatureAttribute(ajc,"Basic");
verifyClassSignature(ajc,"Basic","Ljava/lang/Object;LJ<Ljava/lang/Double;>;LI<Ljava/lang/Double;>;");
}
@@ -582,6 +583,7 @@ public class GenericsTests extends XMLBasedAjcTestCase {
public void testGenericDecpParameterized() {
runTest("generic decp - with parameterized on the target");
+ checkOneSignatureAttribute(ajc,"Basic6");
verifyClassSignature(ajc,"Basic6","<J:Ljava/lang/Object;>Ljava/lang/Object;LI<TJ;>;LK<Ljava/lang/Integer;>;");
}
@@ -953,6 +955,22 @@ public class GenericsTests extends XMLBasedAjcTestCase {
return sigAttr;
}
+ 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();
+ for (int i = 0; i < attrs.length; i++) {
+ Attribute attribute = attrs[i];
+ if (attribute.getName().equals("Signature")) {
+ signatureCount++;
+ sb.append("\n"+((Signature)attribute).getSignature());
+ }
+ }
+ if (signatureCount>1) fail("Should be only one signature attribute but found "+signatureCount+sb.toString());
+ }
+
// Check the signature attribute on a class is correct
public static void verifyClassSignature(Ajc ajc,String classname,String sig) {
Signature sigAttr = getClassSignature(ajc,classname);
diff --git a/weaver/src/org/aspectj/weaver/bcel/LazyClassGen.java b/weaver/src/org/aspectj/weaver/bcel/LazyClassGen.java
index 6279ef144..a22920a77 100644
--- a/weaver/src/org/aspectj/weaver/bcel/LazyClassGen.java
+++ b/weaver/src/org/aspectj/weaver/bcel/LazyClassGen.java
@@ -572,11 +572,9 @@ public final class LazyClassGen {
String s = interfaceRTXs[i].getSignatureForAttribute();
signature.append(s);
}
+ if (sigAttr!=null) myGen.removeAttribute(sigAttr);
myGen.addAttribute(createSignatureAttribute(signature.toString()));
}
-
- // TODO asc generics The 'old' signature is left in the constant pool - I wonder how safe it would be to
- // remove it since we don't know what else (if anything) is referring to it
}
/**