]> source.dussan.org Git - aspectj.git/commitdiff
Some refactoring to try and come up with better type names!
authoraclement <aclement>
Tue, 21 Jun 2005 12:26:14 +0000 (12:26 +0000)
committeraclement <aclement>
Tue, 21 Jun 2005 12:26:14 +0000 (12:26 +0000)
12 files changed:
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AspectDeclaration.java
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceType.java
weaver/src/org/aspectj/weaver/AbstractReferenceTypeDelegate.java [new file with mode: 0644]
weaver/src/org/aspectj/weaver/ReferenceType.java [new file with mode: 0644]
weaver/src/org/aspectj/weaver/ReferenceTypeDelegate.java [new file with mode: 0644]
weaver/src/org/aspectj/weaver/ResolvedTypeX.java
weaver/src/org/aspectj/weaver/TypeX.java
weaver/src/org/aspectj/weaver/World.java
weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java

index 681096b249c08763fe2c72fd4c610817aa47b0c6..dce72fdc85d2442fca711a6d160bf1ff5cec5653 100644 (file)
@@ -51,6 +51,7 @@ import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
 import org.aspectj.weaver.AjAttribute;
 import org.aspectj.weaver.AjcMemberMaker;
 import org.aspectj.weaver.NameMangler;
+import org.aspectj.weaver.ReferenceType;
 import org.aspectj.weaver.ResolvedMember;
 import org.aspectj.weaver.ResolvedTypeX;
 import org.aspectj.weaver.Shadow;
@@ -82,7 +83,7 @@ public class AspectDeclaration extends TypeDeclaration {
        
        public EclipseSourceType concreteName;
        
-       public ResolvedTypeX.Name typeX;
+       public ReferenceType typeX;
        
        public EclipseFactory factory;  //??? should use this consistently
 
index 9629edf4fcc1d1b41e70ffd7273ee283098fd62a..9578f68fc414d0a4a196f5549df05ddc0744c2cc 100644 (file)
@@ -51,6 +51,7 @@ import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
 import org.aspectj.org.eclipse.jdt.internal.compiler.problem.ProblemReporter;
 import org.aspectj.weaver.AsmRelationshipProvider;
 import org.aspectj.weaver.ConcreteTypeMunger;
+import org.aspectj.weaver.ReferenceType;
 import org.aspectj.weaver.ResolvedTypeMunger;
 import org.aspectj.weaver.ResolvedTypeX;
 import org.aspectj.weaver.TypeX;
@@ -286,7 +287,7 @@ public class AjLookupEnvironment extends LookupEnvironment {
         }
 
                if (hasPointcuts || dec instanceof AspectDeclaration) {
-               ResolvedTypeX.Name name = (ResolvedTypeX.Name)factory.fromEclipse(sourceType);
+               ReferenceType name = (ReferenceType)factory.fromEclipse(sourceType);
                EclipseSourceType eclipseSourceType = (EclipseSourceType)name.getDelegate();
                eclipseSourceType.checkPointcutDeclarations();
                }
index 6380392fafc4070c4cd94ba0791132b965f5b17b..d88b9729dda3f59f843fdbe196ec6abc12bd9283 100644 (file)
@@ -30,6 +30,7 @@ import org.aspectj.bridge.IMessage.Kind;
 import org.aspectj.weaver.ConcreteTypeMunger;
 import org.aspectj.weaver.IHasPosition;
 import org.aspectj.weaver.Member;
+import org.aspectj.weaver.ReferenceType;
 import org.aspectj.weaver.ResolvedMember;
 import org.aspectj.weaver.ResolvedTypeX;
 import org.aspectj.weaver.Shadow;
@@ -463,7 +464,7 @@ public class EclipseFactory {
        
        public void addSourceTypeBinding(SourceTypeBinding binding) {
                TypeDeclaration decl = binding.scope.referenceContext;
-               ResolvedTypeX.Name name = getWorld().lookupOrCreateName(TypeX.forName(getName(binding)));
+               ReferenceType name = getWorld().lookupOrCreateName(TypeX.forName(getName(binding)));
                EclipseSourceType t = new EclipseSourceType(name, this, binding, decl);
                name.setDelegate(t);
                if (decl instanceof AspectDeclaration) {
index 88b552b591efd2b6a6682eb475d82d4098cf1981..9f4ba9574657a25eae354d21faf3d75c7d83aa94 100644 (file)
@@ -37,7 +37,7 @@ import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.*;
  * 
  * @author Jim Hugunin
  */
-public class EclipseSourceType extends ResolvedTypeX.ConcreteName {
+public class EclipseSourceType extends AbstractReferenceTypeDelegate {
        private static final char[] pointcutSig = "Lorg/aspectj/lang/annotation/Pointcut;".toCharArray();
     private static final char[] aspectSig = "Lorg/aspectj/lang/annotation/Aspect;".toCharArray();
        protected ResolvedPointcutDefinition[] declaredPointcuts = null;
@@ -58,7 +58,7 @@ public class EclipseSourceType extends ResolvedTypeX.ConcreteName {
                return factory;
        }
 
-       public EclipseSourceType(ResolvedTypeX.Name resolvedTypeX, EclipseFactory factory,
+       public EclipseSourceType(ReferenceType resolvedTypeX, EclipseFactory factory,
                                                                SourceTypeBinding binding, TypeDeclaration declaration)
        {
                super(resolvedTypeX, true);
@@ -435,15 +435,15 @@ public class EclipseSourceType extends ResolvedTypeX.ConcreteName {
     }
 
 
-       protected Collection getDeclares() {
+       public Collection getDeclares() {
                return declares;
        }
 
-       protected Collection getPrivilegedAccesses() {
+       public Collection getPrivilegedAccesses() {
                return Collections.EMPTY_LIST;
        }
 
-       protected Collection getTypeMungers() {
+       public Collection getTypeMungers() {
                return typeMungers;
        }
 
diff --git a/weaver/src/org/aspectj/weaver/AbstractReferenceTypeDelegate.java b/weaver/src/org/aspectj/weaver/AbstractReferenceTypeDelegate.java
new file mode 100644 (file)
index 0000000..c5e29b0
--- /dev/null
@@ -0,0 +1,44 @@
+/* *******************************************************************
+ * Copyright (c) 2002 Contributors
+ * All rights reserved. 
+ * This program and the accompanying materials are made available 
+ * under the terms of the Common Public License v1.0 
+ * which accompanies this distribution and is available at 
+ * http://www.eclipse.org/legal/cpl-v10.html 
+ *  
+ * Contributors: 
+ *     PARC     initial implementation 
+ *     Andy Clement - June 2005 - separated out from ResolvedTypeX
+ * ******************************************************************/
+package org.aspectj.weaver;
+
+public abstract class AbstractReferenceTypeDelegate implements ReferenceTypeDelegate {
+       protected boolean exposedToWeaver;
+       protected ReferenceType resolvedTypeX;
+
+    public AbstractReferenceTypeDelegate(ReferenceType resolvedTypeX, boolean exposedToWeaver) {
+        this.resolvedTypeX = resolvedTypeX;
+        this.exposedToWeaver = exposedToWeaver;
+    }
+        
+       public final boolean isClass() {
+       return !isAspect() && !isInterface();
+    }
+
+       /**
+        * Designed to be overriden by EclipseType to disable collection of shadow mungers
+        * during pre-weave compilation phase
+        */
+       public boolean doesNotExposeShadowMungers() {
+               return false;
+       }
+
+       public boolean isExposedToWeaver() {
+               return exposedToWeaver;
+       }
+
+       public ReferenceType getResolvedTypeX() {
+               return resolvedTypeX;
+       }
+
+}
\ No newline at end of file
diff --git a/weaver/src/org/aspectj/weaver/ReferenceType.java b/weaver/src/org/aspectj/weaver/ReferenceType.java
new file mode 100644 (file)
index 0000000..7f62a00
--- /dev/null
@@ -0,0 +1,197 @@
+/* *******************************************************************
+ * Copyright (c) 2002 Contributors
+ * All rights reserved. 
+ * This program and the accompanying materials are made available 
+ * under the terms of the Common Public License v1.0 
+ * which accompanies this distribution and is available at 
+ * http://www.eclipse.org/legal/cpl-v10.html 
+ *  
+ * Contributors: 
+ *     PARC     initial implementation 
+ *     Andy Clement - June 2005 - separated out from ResolvedTypeX
+ * ******************************************************************/
+package org.aspectj.weaver;
+
+import java.util.Collection;
+import java.util.Iterator;
+
+import org.aspectj.bridge.ISourceLocation;
+import org.aspectj.weaver.patterns.PerClause;
+
+public class ReferenceType extends ResolvedTypeX {
+       ReferenceTypeDelegate delegate = null;
+       ISourceContext sourceContext = null;
+       int startPos = 0;
+       int endPos = 0;
+
+       //??? should set delegate before any use
+    public ReferenceType(String signature, World world) {
+        super(signature, world);
+    }
+        
+    public final boolean isClass() {
+       return delegate.isClass();
+    }
+
+    public AnnotationX[] getAnnotations() {
+       return delegate.getAnnotations();
+    }
+    
+    public void addAnnotation(AnnotationX annotationX) {
+       delegate.addAnnotation(annotationX);
+    }
+    public boolean hasAnnotation(TypeX ofType) {
+       return delegate.hasAnnotation(ofType);
+    }
+    
+    public ResolvedTypeX[] getAnnotationTypes() {
+       return delegate.getAnnotationTypes(); 
+    }
+    
+    public boolean isAspect() {
+       return delegate.isAspect();
+    }
+
+    public boolean isAnnotationStyleAspect() {
+        return delegate.isAnnotationStyleAspect();
+    }
+
+    public boolean isEnum() {
+       return delegate.isEnum();
+    }
+    
+    public boolean isAnnotation() {
+       return delegate.isAnnotation();
+    }
+    
+    public boolean isAnnotationWithRuntimeRetention() {
+        return delegate.isAnnotationWithRuntimeRetention();
+    }
+     
+    public final boolean needsNoConversionFrom(TypeX o) {
+        return isAssignableFrom(o);
+    }
+     
+    public final boolean isAssignableFrom(TypeX o) {
+       if (o.isPrimitive()) {
+               if (!world.behaveInJava5Way) return false;
+               if (ResolvedTypeX.validBoxing.contains(this.getSignature()+o.getSignature())) return true;
+       }
+        ResolvedTypeX other = o.resolve(world);
+
+        return isAssignableFrom(other);
+    }
+    
+    public final boolean isCoerceableFrom(TypeX o) {
+        ResolvedTypeX other = o.resolve(world);
+
+        if (this.isAssignableFrom(other) || other.isAssignableFrom(this)) {
+            return true;
+        }          
+        if (!this.isInterface() && !other.isInterface()) {
+            return false;
+        }
+        if (this.isFinal() || other.isFinal()) {
+            return false;
+        }            
+        // ??? needs to be Methods, not just declared methods? JLS 5.5 unclear
+        ResolvedMember[] a = getDeclaredMethods();
+        ResolvedMember[] b = other.getDeclaredMethods();  //??? is this cast always safe
+        for (int ai = 0, alen = a.length; ai < alen; ai++) {
+            for (int bi = 0, blen = b.length; bi < blen; bi++) {
+                if (! b[bi].isCompatibleWith(a[ai])) return false;
+            }
+        } 
+        return true;
+    }
+    
+    private boolean isAssignableFrom(ResolvedTypeX other) {
+        if (this == other) return true;
+        for(Iterator i = other.getDirectSupertypes(); i.hasNext(); ) {
+            if (this.isAssignableFrom((ResolvedTypeX) i.next())) return true;
+        }       
+        return false;
+    }
+
+       public ISourceContext getSourceContext() {
+               return sourceContext;
+       }
+       
+       public ISourceLocation getSourceLocation() {
+               if (sourceContext == null) return null;
+               return sourceContext.makeSourceLocation(new Position(startPos, endPos));
+       }
+
+       public boolean isExposedToWeaver() {
+               return (delegate == null) || delegate.isExposedToWeaver();  //??? where does this belong
+       }
+       
+       public WeaverStateInfo getWeaverState() {
+               return delegate.getWeaverState();
+       }
+
+       public ResolvedMember[] getDeclaredFields() {
+               return delegate.getDeclaredFields();
+       }
+
+       public ResolvedTypeX[] getDeclaredInterfaces() {
+               return delegate.getDeclaredInterfaces();
+       }
+
+       public ResolvedMember[] getDeclaredMethods() {
+               return delegate.getDeclaredMethods();
+       }
+
+       public ResolvedMember[] getDeclaredPointcuts() {
+               return delegate.getDeclaredPointcuts();
+       }
+
+       public PerClause getPerClause() { return delegate.getPerClause(); }
+       protected Collection getDeclares() { return delegate.getDeclares(); }
+       protected Collection getTypeMungers() { return delegate.getTypeMungers(); }
+       
+       protected Collection getPrivilegedAccesses() { return delegate.getPrivilegedAccesses(); }
+
+
+       public int getModifiers() {
+               return delegate.getModifiers();
+       }
+
+       public ResolvedTypeX getSuperclass() {
+               return delegate.getSuperclass();
+       }
+
+
+       public ReferenceTypeDelegate getDelegate() {
+               return delegate;
+       }
+
+       public void setDelegate(ReferenceTypeDelegate delegate) {
+               this.delegate = delegate;
+       }
+    
+       public int getEndPos() {
+               return endPos;
+       }
+
+       public int getStartPos() {
+               return startPos;
+       }
+
+       public void setEndPos(int endPos) {
+               this.endPos = endPos;
+       }
+
+       public void setSourceContext(ISourceContext sourceContext) {
+               this.sourceContext = sourceContext;
+       }
+
+       public void setStartPos(int startPos) {
+               this.startPos = startPos;
+       }
+       
+       public boolean doesNotExposeShadowMungers() {
+               return delegate.doesNotExposeShadowMungers();
+       }
+
+}
\ No newline at end of file
diff --git a/weaver/src/org/aspectj/weaver/ReferenceTypeDelegate.java b/weaver/src/org/aspectj/weaver/ReferenceTypeDelegate.java
new file mode 100644 (file)
index 0000000..34d9597
--- /dev/null
@@ -0,0 +1,55 @@
+/* *******************************************************************
+ * Copyright (c) 2002 Contributors
+ * All rights reserved. 
+ * This program and the accompanying materials are made available 
+ * under the terms of the Common Public License v1.0 
+ * which accompanies this distribution and is available at 
+ * http://www.eclipse.org/legal/cpl-v10.html 
+ *  
+ * Contributors: 
+ *     PARC     initial implementation 
+ *     Andy Clement - June 2005 - separated out from ResolvedTypeX
+ * ******************************************************************/
+package org.aspectj.weaver;
+
+import java.util.Collection;
+
+import org.aspectj.weaver.patterns.PerClause;
+
+/**
+ * Abstraction over a type.  Abstract implementation provided by 
+ * AbstractReferenceTypeDelegate.
+ */
+public interface ReferenceTypeDelegate {
+       
+       // TODO asc move to proxy
+       public void addAnnotation(AnnotationX annotationX);
+
+       public boolean isAspect();
+    public boolean isAnnotationStyleAspect();
+    public boolean isInterface();
+    public boolean isEnum();
+    public boolean isAnnotation();
+    public boolean isAnnotationWithRuntimeRetention();
+       public boolean isClass();
+       public boolean isExposedToWeaver();
+       
+       public boolean hasAnnotation(TypeX ofType);
+       
+       public AnnotationX[]    getAnnotations();
+    public ResolvedTypeX[]  getAnnotationTypes();
+       public ResolvedMember[] getDeclaredFields();
+       public ResolvedTypeX[]  getDeclaredInterfaces();
+       public ResolvedMember[] getDeclaredMethods();
+       public ResolvedMember[] getDeclaredPointcuts();
+
+       public PerClause  getPerClause();
+       public Collection getDeclares() ;
+       public Collection getTypeMungers();
+       public Collection getPrivilegedAccesses();
+       public int getModifiers();
+       public ResolvedTypeX getSuperclass();           
+       public WeaverStateInfo getWeaverState();
+       public ReferenceType getResolvedTypeX();
+       public boolean doesNotExposeShadowMungers();
+}
\ No newline at end of file
index 52813072df46f58cf204f45265f42a4eb8aa8ae1..45f1cfd51597164e85f71d077dec544ed27d2b47 100644 (file)
@@ -105,7 +105,7 @@ public abstract class ResolvedTypeX extends TypeX implements AnnotatedElement {
     // This set contains pairs of types whose signatures are concatenated
     // together, this means with a fast lookup we can tell if two types
     // are equivalent.
-    private static Set validBoxing = new HashSet();
+    static Set validBoxing = new HashSet();
     
     static {
       validBoxing.add("Ljava/lang/Byte;B");
@@ -631,258 +631,6 @@ public abstract class ResolvedTypeX extends TypeX implements AnnotatedElement {
     
     // ---- types
     
-    public static class Name extends ResolvedTypeX {
-       private ConcreteName delegate = null;
-       private ISourceContext sourceContext = null;
-       private int startPos = 0;
-       private int endPos = 0;
-
-               //??? should set delegate before any use
-        public Name(String signature, World world) {
-            super(signature, world);
-        }
-               
-           public final boolean isClass() {
-               return delegate.isClass();
-           }
-
-           public AnnotationX[] getAnnotations() {
-               return delegate.getAnnotations();
-           }
-           
-           public void addAnnotation(AnnotationX annotationX) {
-               delegate.addAnnotation(annotationX);
-           }
-           public boolean hasAnnotation(TypeX ofType) {
-               return delegate.hasAnnotation(ofType);
-           }
-           
-           public ResolvedTypeX[] getAnnotationTypes() {
-               return delegate.getAnnotationTypes(); 
-           }
-           
-           public boolean isAspect() {
-               return delegate.isAspect();
-           }
-
-        public boolean isAnnotationStyleAspect() {
-            return delegate.isAnnotationStyleAspect();
-        }
-
-           public boolean isEnum() {
-               return delegate.isEnum();
-           }
-           
-           public boolean isAnnotation() {
-               return delegate.isAnnotation();
-           }
-           
-           public boolean isAnnotationWithRuntimeRetention() {
-               return delegate.isAnnotationWithRuntimeRetention();
-           }
-            
-        public final boolean needsNoConversionFrom(TypeX o) {
-            return isAssignableFrom(o);
-        }
-            
-        public final boolean isAssignableFrom(TypeX o) {
-               if (o.isPrimitive()) {
-                       if (!world.behaveInJava5Way) return false;
-                       if (validBoxing.contains(this.getSignature()+o.getSignature())) return true;
-               }
-            ResolvedTypeX other = o.resolve(world);
-
-            return isAssignableFrom(other);
-        }
-        
-        public final boolean isCoerceableFrom(TypeX o) {
-            ResolvedTypeX other = o.resolve(world);
-
-            if (this.isAssignableFrom(other) || other.isAssignableFrom(this)) {
-                return true;
-            }          
-            if (!this.isInterface() && !other.isInterface()) {
-                return false;
-            }
-            if (this.isFinal() || other.isFinal()) {
-                return false;
-            }            
-            // ??? needs to be Methods, not just declared methods? JLS 5.5 unclear
-            ResolvedMember[] a = getDeclaredMethods();
-            ResolvedMember[] b = other.getDeclaredMethods();  //??? is this cast always safe
-            for (int ai = 0, alen = a.length; ai < alen; ai++) {
-                for (int bi = 0, blen = b.length; bi < blen; bi++) {
-                    if (! b[bi].isCompatibleWith(a[ai])) return false;
-                }
-            } 
-            return true;
-        }
-        
-        private boolean isAssignableFrom(ResolvedTypeX other) {
-            if (this == other) return true;
-            for(Iterator i = other.getDirectSupertypes(); i.hasNext(); ) {
-                if (this.isAssignableFrom((ResolvedTypeX) i.next())) return true;
-            }       
-            return false;
-        }
-
-               public ISourceContext getSourceContext() {
-                       return sourceContext;
-               }
-               
-               public ISourceLocation getSourceLocation() {
-                       if (sourceContext == null) return null;
-                       return sourceContext.makeSourceLocation(new Position(startPos, endPos));
-               }
-
-               public boolean isExposedToWeaver() {
-                       return (delegate == null) || delegate.isExposedToWeaver();  //??? where does this belong
-               }
-               
-               public WeaverStateInfo getWeaverState() {
-                       return delegate.getWeaverState();
-               }
-
-               public ResolvedMember[] getDeclaredFields() {
-                       return delegate.getDeclaredFields();
-               }
-
-               public ResolvedTypeX[] getDeclaredInterfaces() {
-                       return delegate.getDeclaredInterfaces();
-               }
-
-               public ResolvedMember[] getDeclaredMethods() {
-                       return delegate.getDeclaredMethods();
-               }
-
-               public ResolvedMember[] getDeclaredPointcuts() {
-                       return delegate.getDeclaredPointcuts();
-               }
-
-               public PerClause getPerClause() { return delegate.getPerClause(); }
-               protected Collection getDeclares() { return delegate.getDeclares(); }
-               protected Collection getTypeMungers() { return delegate.getTypeMungers(); }
-               
-               protected Collection getPrivilegedAccesses() { return delegate.getPrivilegedAccesses(); }
-
-
-               public int getModifiers() {
-                       return delegate.getModifiers();
-               }
-
-               public ResolvedTypeX getSuperclass() {
-                       return delegate.getSuperclass();
-               }
-
-
-               public ConcreteName getDelegate() {
-                       return delegate;
-               }
-
-               public void setDelegate(ConcreteName delegate) {
-                       this.delegate = delegate;
-               }
-        
-               public int getEndPos() {
-                       return endPos;
-               }
-
-               public int getStartPos() {
-                       return startPos;
-               }
-
-               public void setEndPos(int endPos) {
-                       this.endPos = endPos;
-               }
-
-               public void setSourceContext(ISourceContext sourceContext) {
-                       this.sourceContext = sourceContext;
-               }
-
-               public void setStartPos(int startPos) {
-                       this.startPos = startPos;
-               }
-               
-               public boolean doesNotExposeShadowMungers() {
-                       return delegate.doesNotExposeShadowMungers();
-               }
-
-    }
-    
-    public static abstract class ConcreteName {
-       //protected ISourceContext sourceContext;
-       protected boolean exposedToWeaver;
-       protected ResolvedTypeX.Name resolvedTypeX;
-       
-
-        public ConcreteName(ResolvedTypeX.Name resolvedTypeX, boolean exposedToWeaver) {
-            //???super(signature, world);
-            this.resolvedTypeX = resolvedTypeX;
-            this.exposedToWeaver = exposedToWeaver;
-        }
-               
-
-               public final boolean isClass() {
-               return !isAspect() && !isInterface();
-           }
-           
-           public abstract boolean isAspect();
-        public abstract boolean isAnnotationStyleAspect();
-           public abstract boolean isInterface();
-           public abstract boolean isEnum();
-           public abstract boolean isAnnotation();
-           public abstract boolean isAnnotationWithRuntimeRetention();
-           
-           public abstract AnnotationX[] getAnnotations();
-               public abstract void addAnnotation(AnnotationX annotationX);
-           public abstract boolean hasAnnotation(TypeX ofType);
-           public abstract ResolvedTypeX[] getAnnotationTypes();
-
-               public abstract ResolvedMember[] getDeclaredFields();
-
-               public abstract ResolvedTypeX[] getDeclaredInterfaces();
-
-               public abstract ResolvedMember[] getDeclaredMethods();
-
-               public abstract ResolvedMember[] getDeclaredPointcuts();
-
-               public abstract PerClause getPerClause();
-               protected abstract Collection getDeclares() ;
-               protected abstract Collection getTypeMungers();
-               
-               protected abstract Collection getPrivilegedAccesses();
-
-
-               public abstract int getModifiers();
-
-               public abstract ResolvedTypeX getSuperclass();
-
-//             public abstract ISourceLocation getSourceLocation();
-
-               public abstract WeaverStateInfo getWeaverState();
-
-//             public ISourceContext getSourceContext() {
-//                     return sourceContext;
-//             }
-
-               /**
-                * Designed to be overriden by EclipseType to disable collection of shadow mungers
-                * during pre-weave compilation phase
-                */
-               public boolean doesNotExposeShadowMungers() {
-                       return false;
-               }
-
-               public boolean isExposedToWeaver() {
-                       return exposedToWeaver;
-               }
-
-               public ResolvedTypeX.Name getResolvedTypeX() {
-                       return resolvedTypeX;
-               }
-
-       }
-    
     static class Array extends ResolvedTypeX {
         ResolvedTypeX componentType;
         Array(String s, World world, ResolvedTypeX componentType) {
index e57cdf5d1679b2b7a0b94c86fdd8272e9e1b49af..9888be428b6baf5b256c349a1fd6218054df18e3 100644 (file)
@@ -40,7 +40,7 @@ public class TypeX implements AnnotatedElement {
        // an inner type of a parameterized type that specifies no type parameters of its own.
        protected TypeX[] typeParameters;
        private boolean isParameterized = false;
-       private boolean isRawtype = false;
+       private boolean isRawtype = false; // TODO asc - change to isGeneric?
        
 
        /**
index f721cc4fb58ec65853909373666c71b41c5c2044..0ab778f7d4d6a358fd7c1c9203e10ce67eb698fc 100644 (file)
@@ -156,14 +156,14 @@ public abstract class World implements Dump.INode {
     protected final ResolvedTypeX resolveObjectType(TypeX ty) {
                String signature = ty.getRawTypeSignature();
 
-       ResolvedTypeX.Name name = new ResolvedTypeX.Name(signature, this);
-       ResolvedTypeX.ConcreteName concreteName = resolveObjectType(name);
+       ReferenceType name = new ReferenceType(signature, this);
+       ReferenceTypeDelegate concreteName = resolveObjectType(name);
        if (concreteName == null) return ResolvedTypeX.MISSING;
        name.setDelegate(concreteName);
        return name;
     }
     
-    protected abstract ResolvedTypeX.ConcreteName resolveObjectType(ResolvedTypeX.Name ty);
+    protected abstract ReferenceTypeDelegate resolveObjectType(ReferenceType ty);
     
 
     protected final boolean isCoerceableFrom(TypeX type, TypeX other) {
@@ -475,11 +475,11 @@ public abstract class World implements Dump.INode {
                XlazyTjp = b;
        }
 
-       public ResolvedTypeX.Name lookupOrCreateName(TypeX ty) {
+       public ReferenceType lookupOrCreateName(TypeX ty) {
                String signature = ty.getRawTypeSignature();
-        ResolvedTypeX.Name ret = (ResolvedTypeX.Name)typeMap.get(signature);
+        ReferenceType ret = (ReferenceType)typeMap.get(signature);
         if (ret == null) {
-               ret = new ResolvedTypeX.Name(signature, this);
+               ret = new ReferenceType(signature, this);
                typeMap.put(signature, ret);
         }
         
index 47e814f6b54475ac2d133dea45c717a14897aa47..b95e66ba6b08868a1c64ca1addaf1988a123156a 100644 (file)
@@ -28,9 +28,11 @@ import org.aspectj.apache.bcel.classfile.annotation.Annotation;
 import org.aspectj.apache.bcel.classfile.annotation.ElementNameValuePair;
 import org.aspectj.apache.bcel.classfile.annotation.ElementValue;
 import org.aspectj.bridge.ISourceLocation;
+import org.aspectj.weaver.AbstractReferenceTypeDelegate;
 import org.aspectj.weaver.AjAttribute;
 import org.aspectj.weaver.AnnotationX;
 import org.aspectj.weaver.BCException;
+import org.aspectj.weaver.ReferenceType;
 import org.aspectj.weaver.ResolvedMember;
 import org.aspectj.weaver.ResolvedPointcutDefinition;
 import org.aspectj.weaver.ResolvedTypeX;
@@ -41,7 +43,7 @@ import org.aspectj.weaver.patterns.PerClause;
 
 
 // ??? exposed for testing
-public class BcelObjectType extends ResolvedTypeX.ConcreteName {
+public class BcelObjectType extends AbstractReferenceTypeDelegate {
     private JavaClass javaClass;
     private boolean isObject = false;  // set upon construction
        private LazyClassGen lazyClassGen = null;  // set lazily if it's an aspect
@@ -89,7 +91,7 @@ public class BcelObjectType extends ResolvedTypeX.ConcreteName {
        
     
     // IMPORTANT! THIS DOESN'T do real work on the java class, just stores it away.
-    BcelObjectType(ResolvedTypeX.Name resolvedTypeX, JavaClass javaClass, boolean exposedToWeaver) {
+    BcelObjectType(ReferenceType resolvedTypeX, JavaClass javaClass, boolean exposedToWeaver) {
         super(resolvedTypeX, exposedToWeaver);
         this.javaClass = javaClass;
 
index 1b8a57f908bb7bd8c36c0d1a8a02f0a2ec1f907c..71e8eb7cf8f86b22bac3536a49073ce6a40676a5 100644 (file)
@@ -43,6 +43,8 @@ import org.aspectj.weaver.AjAttribute;
 import org.aspectj.weaver.ConcreteTypeMunger;
 import org.aspectj.weaver.ICrossReferenceHandler;
 import org.aspectj.weaver.Member;
+import org.aspectj.weaver.ReferenceType;
+import org.aspectj.weaver.ReferenceTypeDelegate;
 import org.aspectj.weaver.ResolvedMember;
 import org.aspectj.weaver.ResolvedTypeMunger;
 import org.aspectj.weaver.ResolvedTypeX;
@@ -217,7 +219,7 @@ public class BcelWorld extends World implements Repository {
     }       
 
 
-       protected ResolvedTypeX.ConcreteName resolveObjectType(ResolvedTypeX.Name ty) {
+       protected ReferenceTypeDelegate resolveObjectType(ReferenceType ty) {
         String name = ty.getName();
         JavaClass jc = null;
         //UnwovenClassFile classFile = (UnwovenClassFile)sourceJavaClasses.get(name);
@@ -235,7 +237,7 @@ public class BcelWorld extends World implements Repository {
         }
        }
        
-       protected BcelObjectType makeBcelObjectType(ResolvedTypeX.Name resolvedTypeX, JavaClass jc, boolean exposedToWeaver) {
+       protected BcelObjectType makeBcelObjectType(ReferenceType resolvedTypeX, JavaClass jc, boolean exposedToWeaver) {
                BcelObjectType ret = new BcelObjectType(resolvedTypeX, jc, exposedToWeaver);
                return ret;
        }
@@ -267,10 +269,10 @@ public class BcelWorld extends World implements Repository {
        
        public BcelObjectType addSourceObjectType(JavaClass jc) {
                String signature = TypeX.forName(jc.getClassName()).getSignature();
-        ResolvedTypeX.Name nameTypeX = (ResolvedTypeX.Name)typeMap.get(signature);
+        ReferenceType nameTypeX = (ReferenceType)typeMap.get(signature);
 
         if (nameTypeX == null) {
-               nameTypeX = new ResolvedTypeX.Name(signature, this);
+               nameTypeX = new ReferenceType(signature, this);
         }
         BcelObjectType ret = makeBcelObjectType(nameTypeX, jc, true);
         typeMap.put(signature, nameTypeX);
@@ -411,7 +413,7 @@ public class BcelWorld extends World implements Repository {
 
        public static BcelObjectType getBcelObjectType(ResolvedTypeX concreteAspect) {
                //XXX need error checking
-               return (BcelObjectType) ((ResolvedTypeX.Name)concreteAspect).getDelegate();
+               return (BcelObjectType) ((ReferenceType)concreteAspect).getDelegate();
        }
 
        public void tidyUp() {