]> source.dussan.org Git - aspectj.git/commitdiff
pr122248, only unpack generic signatures if the world is in java 5 mode...
authoracolyer <acolyer>
Sun, 15 Jan 2006 21:33:55 +0000 (21:33 +0000)
committeracolyer <acolyer>
Sun, 15 Jan 2006 21:33:55 +0000 (21:33 +0000)
weaver/src/org/aspectj/weaver/bcel/BcelField.java
weaver/src/org/aspectj/weaver/bcel/BcelMethod.java
weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java
weaver/testsrc/org/aspectj/weaver/MemberTestCase15.java

index b5346b158e0da64d88ce414798ca5241607dd9c4..d512aaca48fff463056574f25fcc94ad53657890 100644 (file)
@@ -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) {
index b5555553b7891add8cadaf9a89e8564a5e72e64a..b54226745f8e22663020a62727b4ab1fa759160b 100644 (file)
@@ -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) {
index 8ee6ab6384bbb75c461fc365d6fb89d09c350167..f83d96b7f3c225b84d3d652889598f69c4db2244 100644 (file)
@@ -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) {
index a3c60d709e763c666999eda2ec177780e245b114..8014289e7dd393922a735e5a6b0ad9a8d72c6548 100644 (file)
@@ -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