diff options
author | acolyer <acolyer> | 2006-01-15 21:33:55 +0000 |
---|---|---|
committer | acolyer <acolyer> | 2006-01-15 21:33:55 +0000 |
commit | 3f77e755e504d24e0dc6fd640972d56de15a6bef (patch) | |
tree | 2c55d711eb651b03b5eebea727a343bfec61de6d | |
parent | dd1203a376d6b0dcc865735cf50288a83e710b05 (diff) | |
download | aspectj-3f77e755e504d24e0dc6fd640972d56de15a6bef.tar.gz aspectj-3f77e755e504d24e0dc6fd640972d56de15a6bef.zip |
pr122248, only unpack generic signatures if the world is in java 5 mode...
4 files changed, 16 insertions, 2 deletions
diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelField.java b/weaver/src/org/aspectj/weaver/bcel/BcelField.java index b5346b158..d512aaca4 100644 --- a/weaver/src/org/aspectj/weaver/bcel/BcelField.java +++ b/weaver/src/org/aspectj/weaver/bcel/BcelField.java @@ -156,8 +156,11 @@ final class BcelField extends ResolvedMemberImpl { } private void unpackGenericSignature() { - if (unpackedGenericSignature) - return; + if (unpackedGenericSignature) { return; } + if (!world.isInJava5Mode()) { + this.genericFieldType = getReturnType(); + return; + } unpackedGenericSignature = true; String gSig = field.getGenericSignature(); if (gSig != null) { diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelMethod.java b/weaver/src/org/aspectj/weaver/bcel/BcelMethod.java index b5555553b..b54226745 100644 --- a/weaver/src/org/aspectj/weaver/bcel/BcelMethod.java +++ b/weaver/src/org/aspectj/weaver/bcel/BcelMethod.java @@ -265,6 +265,12 @@ final class BcelMethod extends ResolvedMemberImpl { private void unpackGenericSignature() { if (unpackedGenericSignature) return; + if (!world.isInJava5Mode()) { + this.genericReturnType = getReturnType(); + this.genericParameterTypes = getParameterTypes(); + return; + } + // ok, we have work to do... unpackedGenericSignature = true; String gSig = method.getGenericSignature(); if (gSig != null) { diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java b/weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java index 8ee6ab638..f83d96b7f 100644 --- a/weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java +++ b/weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java @@ -633,6 +633,9 @@ public class BcelObjectType extends AbstractReferenceTypeDelegate { private void unpackGenericSignature() { if (genericSignatureUnpacked) return; + if (!getResolvedTypeX().getWorld().isInJava5Mode()) { + return; + } genericSignatureUnpacked = true; Signature.ClassSignature cSig = getGenericClassTypeSignature(); if (cSig != null) { diff --git a/weaver/testsrc/org/aspectj/weaver/MemberTestCase15.java b/weaver/testsrc/org/aspectj/weaver/MemberTestCase15.java index a3c60d709..8014289e7 100644 --- a/weaver/testsrc/org/aspectj/weaver/MemberTestCase15.java +++ b/weaver/testsrc/org/aspectj/weaver/MemberTestCase15.java @@ -40,6 +40,7 @@ public class MemberTestCase15 extends TestCase { public void testCanBeParameterizedGenericMethod() { BcelWorld world = new BcelWorld(); + world.setBehaveInJava5Way(true); ResolvedType javaLangClass = world.resolve(UnresolvedType.forName("java.lang.Class")); javaLangClass = javaLangClass.getGenericType(); if (javaLangClass == null) return; // for < 1.5 @@ -59,6 +60,7 @@ public class MemberTestCase15 extends TestCase { public void testCanBeParameterizedMethodInGenericType() { BcelWorld world = new BcelWorld(); + world.setBehaveInJava5Way(true); ResolvedType javaUtilList = world.resolve(UnresolvedType.forName("java.util.List")); javaUtilList = javaUtilList.getGenericType(); if (javaUtilList == null) return; // for < 1.5 |