]> source.dussan.org Git - aspectj.git/commitdiff
extracted inner type to top level type
authoraclement <aclement>
Mon, 22 Mar 2010 22:34:36 +0000 (22:34 +0000)
committeraclement <aclement>
Mon, 22 Mar 2010 22:34:36 +0000 (22:34 +0000)
org.aspectj.matcher/src/org/aspectj/weaver/BoundedReferenceType.java
org.aspectj.matcher/src/org/aspectj/weaver/BoundedReferenceTypeDelegate.java [new file with mode: 0644]
org.aspectj.matcher/src/org/aspectj/weaver/TypeVariableReferenceType.java

index 0043f7830b6eb3e240dce2000d43d934a65ce9eb..11796aa7ddd0cdb0a7fd33f5185be67033566d8d 100644 (file)
@@ -1,22 +1,15 @@
 /* *******************************************************************
- * Copyright (c) 2005 Contributors.
+ * Copyright (c) 2010 Contributors.
  * All rights reserved. 
  * This program and the accompanying materials are made available 
  * under the terms of the Eclipse Public License v1.0 
  * which accompanies this distribution and is available at 
  * http://eclipse.org/legal/epl-v10.html 
- *  
- * Contributors: 
- *   Adrian Colyer                     Initial implementation
  * ******************************************************************/
 package org.aspectj.weaver;
 
-import java.util.Collection;
-import java.util.Collections;
 import java.util.Map;
 
-import org.aspectj.weaver.patterns.PerClause;
-
 /**
  * A BoundedReferenceType is the result of a generics wildcard expression ? extends String, ? super Foo etc..
  * 
@@ -24,6 +17,9 @@ import org.aspectj.weaver.patterns.PerClause;
  * signature strings.
  * 
  * The bound may be a type variable (e.g. ? super T)
+ * 
+ * @author Adrian Colyer
+ * @author Andy Clement
  */
 public class BoundedReferenceType extends ReferenceType {
 
@@ -55,7 +51,7 @@ public class BoundedReferenceType extends ReferenceType {
                        lowerBound = aBound;
                        upperBound = world.resolve(UnresolvedType.OBJECT);
                }
-               setDelegate(new ReferenceTypeReferenceTypeDelegate((ReferenceType) getUpperBound()));
+               setDelegate(new BoundedReferenceTypeDelegate((ReferenceType) getUpperBound()));
        }
 
        public BoundedReferenceType(ReferenceType aBound, boolean isExtends, World world, ReferenceType[] additionalInterfaces) {
@@ -88,7 +84,7 @@ public class BoundedReferenceType extends ReferenceType {
        protected BoundedReferenceType(String sig, String sigErasure, World world) {
                super(sig, sigErasure, world);
                upperBound = world.resolve(UnresolvedType.OBJECT);
-               setDelegate(new ReferenceTypeReferenceTypeDelegate((ReferenceType) getUpperBound()));
+               setDelegate(new BoundedReferenceTypeDelegate((ReferenceType) getUpperBound()));
        }
 
        public ReferenceType[] getInterfaceBounds() {
@@ -177,128 +173,4 @@ public class BoundedReferenceType extends ReferenceType {
        public boolean isGenericWildcard() {
                return true;
        }
-
-       protected static class ReferenceTypeReferenceTypeDelegate extends AbstractReferenceTypeDelegate {
-
-               public ReferenceTypeReferenceTypeDelegate(ReferenceType backing) {
-                       super(backing, false);
-               }
-
-               public boolean isAspect() {
-                       return resolvedTypeX.isAspect();
-               }
-
-               public boolean isAnnotationStyleAspect() {
-                       return resolvedTypeX.isAnnotationStyleAspect();
-               }
-
-               public boolean isInterface() {
-                       return resolvedTypeX.isInterface();
-               }
-
-               public boolean isEnum() {
-                       return resolvedTypeX.isEnum();
-               }
-
-               public boolean isAnnotation() {
-                       return resolvedTypeX.isAnnotation();
-               }
-
-               public boolean isAnnotationWithRuntimeRetention() {
-                       return resolvedTypeX.isAnnotationWithRuntimeRetention();
-               }
-
-               public boolean isAnonymous() {
-                       return resolvedTypeX.isAnonymous();
-               }
-
-               public boolean isNested() {
-                       return resolvedTypeX.isNested();
-               }
-
-               public ResolvedType getOuterClass() {
-                       return resolvedTypeX.getOuterClass();
-               }
-
-               public String getRetentionPolicy() {
-                       return resolvedTypeX.getRetentionPolicy();
-               }
-
-               public boolean canAnnotationTargetType() {
-                       return resolvedTypeX.canAnnotationTargetType();
-               }
-
-               public AnnotationTargetKind[] getAnnotationTargetKinds() {
-                       return resolvedTypeX.getAnnotationTargetKinds();
-               }
-
-               public boolean isGeneric() {
-                       return resolvedTypeX.isGenericType();
-               }
-
-               public String getDeclaredGenericSignature() {
-                       return resolvedTypeX.getDeclaredGenericSignature();
-               }
-
-               public boolean hasAnnotation(UnresolvedType ofType) {
-                       return resolvedTypeX.hasAnnotation(ofType);
-               }
-
-               public AnnotationAJ[] getAnnotations() {
-                       return resolvedTypeX.getAnnotations();
-               }
-
-               public ResolvedType[] getAnnotationTypes() {
-                       return resolvedTypeX.getAnnotationTypes();
-               }
-
-               public ResolvedMember[] getDeclaredFields() {
-                       return resolvedTypeX.getDeclaredFields();
-               }
-
-               public ResolvedType[] getDeclaredInterfaces() {
-                       return resolvedTypeX.getDeclaredInterfaces();
-               }
-
-               public ResolvedMember[] getDeclaredMethods() {
-                       return resolvedTypeX.getDeclaredMethods();
-               }
-
-               public ResolvedMember[] getDeclaredPointcuts() {
-                       return resolvedTypeX.getDeclaredPointcuts();
-               }
-
-               public PerClause getPerClause() {
-                       return resolvedTypeX.getPerClause();
-               }
-
-               public Collection getDeclares() {
-                       return resolvedTypeX.getDeclares();
-               }
-
-               public Collection getTypeMungers() {
-                       return resolvedTypeX.getTypeMungers();
-               }
-
-               public Collection getPrivilegedAccesses() {
-                       return Collections.EMPTY_LIST;
-               }
-
-               public int getModifiers() {
-                       return resolvedTypeX.getModifiers();
-               }
-
-               public ResolvedType getSuperclass() {
-                       return resolvedTypeX.getSuperclass();
-               }
-
-               public WeaverStateInfo getWeaverState() {
-                       return null;
-               }
-
-               public TypeVariable[] getTypeVariables() {
-                       return resolvedTypeX.getTypeVariables();
-               }
-
-       }
 }
diff --git a/org.aspectj.matcher/src/org/aspectj/weaver/BoundedReferenceTypeDelegate.java b/org.aspectj.matcher/src/org/aspectj/weaver/BoundedReferenceTypeDelegate.java
new file mode 100644 (file)
index 0000000..03a2c4f
--- /dev/null
@@ -0,0 +1,133 @@
+/**
+ * 
+ */
+package org.aspectj.weaver;
+
+import java.util.Collection;
+import java.util.Collections;
+
+import org.aspectj.weaver.patterns.PerClause;
+
+class BoundedReferenceTypeDelegate extends AbstractReferenceTypeDelegate {
+
+       public BoundedReferenceTypeDelegate(ReferenceType backing) {
+               super(backing, false);
+       }
+
+       public boolean isAspect() {
+               return resolvedTypeX.isAspect();
+       }
+
+       public boolean isAnnotationStyleAspect() {
+               return resolvedTypeX.isAnnotationStyleAspect();
+       }
+
+       public boolean isInterface() {
+               return resolvedTypeX.isInterface();
+       }
+
+       public boolean isEnum() {
+               return resolvedTypeX.isEnum();
+       }
+
+       public boolean isAnnotation() {
+               return resolvedTypeX.isAnnotation();
+       }
+
+       public boolean isAnnotationWithRuntimeRetention() {
+               return resolvedTypeX.isAnnotationWithRuntimeRetention();
+       }
+
+       public boolean isAnonymous() {
+               return resolvedTypeX.isAnonymous();
+       }
+
+       public boolean isNested() {
+               return resolvedTypeX.isNested();
+       }
+
+       public ResolvedType getOuterClass() {
+               return resolvedTypeX.getOuterClass();
+       }
+
+       public String getRetentionPolicy() {
+               return resolvedTypeX.getRetentionPolicy();
+       }
+
+       public boolean canAnnotationTargetType() {
+               return resolvedTypeX.canAnnotationTargetType();
+       }
+
+       public AnnotationTargetKind[] getAnnotationTargetKinds() {
+               return resolvedTypeX.getAnnotationTargetKinds();
+       }
+
+       public boolean isGeneric() {
+               return resolvedTypeX.isGenericType();
+       }
+
+       public String getDeclaredGenericSignature() {
+               return resolvedTypeX.getDeclaredGenericSignature();
+       }
+
+       public boolean hasAnnotation(UnresolvedType ofType) {
+               return resolvedTypeX.hasAnnotation(ofType);
+       }
+
+       public AnnotationAJ[] getAnnotations() {
+               return resolvedTypeX.getAnnotations();
+       }
+
+       public ResolvedType[] getAnnotationTypes() {
+               return resolvedTypeX.getAnnotationTypes();
+       }
+
+       public ResolvedMember[] getDeclaredFields() {
+               return resolvedTypeX.getDeclaredFields();
+       }
+
+       public ResolvedType[] getDeclaredInterfaces() {
+               return resolvedTypeX.getDeclaredInterfaces();
+       }
+
+       public ResolvedMember[] getDeclaredMethods() {
+               return resolvedTypeX.getDeclaredMethods();
+       }
+
+       public ResolvedMember[] getDeclaredPointcuts() {
+               return resolvedTypeX.getDeclaredPointcuts();
+       }
+
+       public PerClause getPerClause() {
+               return resolvedTypeX.getPerClause();
+       }
+
+       public Collection getDeclares() {
+               return resolvedTypeX.getDeclares();
+       }
+
+       public Collection getTypeMungers() {
+               return resolvedTypeX.getTypeMungers();
+       }
+
+       public Collection getPrivilegedAccesses() {
+               return Collections.EMPTY_LIST;
+       }
+
+       public int getModifiers() {
+               return resolvedTypeX.getModifiers();
+       }
+
+       public ResolvedType getSuperclass() {
+               return resolvedTypeX.getSuperclass();
+       }
+
+       public WeaverStateInfo getWeaverState() {
+               return null;
+       }
+
+       public TypeVariable[] getTypeVariables() {
+               return resolvedTypeX.getTypeVariables();
+       }
+
+}
\ No newline at end of file
index 69ab2dae089789a92a353ceafdac5b113d6946be..06dac2a096a952c1121ede5449c24bab6a9173e0 100644 (file)
@@ -38,7 +38,7 @@ public class TypeVariableReferenceType extends BoundedReferenceType implements T
 
        public ReferenceTypeDelegate getDelegate() {
                if (delegate == null)
-                       setDelegate(new ReferenceTypeReferenceTypeDelegate((ReferenceType) typeVariable.getFirstBound()));
+                       setDelegate(new BoundedReferenceTypeDelegate((ReferenceType) typeVariable.getFirstBound()));
                return delegate;
        }