]> source.dussan.org Git - aspectj.git/commitdiff
https://bugs.eclipse.org/bugs/show_bug.cgi?id=329268 from Nieraj
authoraclement <aclement>
Mon, 22 Nov 2010 19:45:03 +0000 (19:45 +0000)
committeraclement <aclement>
Mon, 22 Nov 2010 19:45:03 +0000 (19:45 +0000)
org.aspectj.matcher/src/org/aspectj/weaver/patterns/AnyTypePattern.java [new file with mode: 0644]
org.aspectj.matcher/src/org/aspectj/weaver/patterns/AnyWithAnnotationTypePattern.java [new file with mode: 0644]
org.aspectj.matcher/src/org/aspectj/weaver/patterns/BindingTypePattern.java
org.aspectj.matcher/src/org/aspectj/weaver/patterns/EllipsisTypePattern.java [new file with mode: 0644]
org.aspectj.matcher/src/org/aspectj/weaver/patterns/HasMemberTypePattern.java
org.aspectj.matcher/src/org/aspectj/weaver/patterns/NoTypePattern.java [new file with mode: 0644]
org.aspectj.matcher/src/org/aspectj/weaver/patterns/TypeCategoryTypePattern.java
org.aspectj.matcher/src/org/aspectj/weaver/patterns/TypePattern.java

diff --git a/org.aspectj.matcher/src/org/aspectj/weaver/patterns/AnyTypePattern.java b/org.aspectj.matcher/src/org/aspectj/weaver/patterns/AnyTypePattern.java
new file mode 100644 (file)
index 0000000..f368553
--- /dev/null
@@ -0,0 +1,112 @@
+/* *******************************************************************
+ * Copyright (c) 2002, 2010 Palo Alto Research Center, Incorporated (PARC) and others.
+ * 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://www.eclipse.org/legal/epl-v10.html 
+ *  
+ * Contributors: 
+ *     PARC     initial implementation 
+ * ******************************************************************/
+package org.aspectj.weaver.patterns;
+
+import java.io.IOException;
+import java.util.Map;
+
+import org.aspectj.util.FuzzyBoolean;
+import org.aspectj.weaver.CompressingDataOutputStream;
+import org.aspectj.weaver.ResolvedType;
+import org.aspectj.weaver.World;
+
+public class AnyTypePattern extends TypePattern {
+
+       /**
+        * Constructor for EllipsisTypePattern.
+        * 
+        * @param includeSubtypes
+        */
+       public AnyTypePattern() {
+               super(false, false, new TypePatternList());
+       }
+
+       /*
+        * (non-Javadoc)
+        * 
+        * @see org.aspectj.weaver.patterns.TypePattern#couldEverMatchSameTypesAs(org.aspectj.weaver.patterns.TypePattern)
+        */
+       @Override
+       protected boolean couldEverMatchSameTypesAs(TypePattern other) {
+               return true;
+       }
+
+       /**
+        * @see org.aspectj.weaver.patterns.TypePattern#matchesExactly(IType)
+        */
+       @Override
+       protected boolean matchesExactly(ResolvedType type) {
+               return true;
+       }
+
+       @Override
+       protected boolean matchesExactly(ResolvedType type, ResolvedType annotatedType) {
+               return true;
+       }
+
+       /**
+        * @see org.aspectj.weaver.patterns.TypePattern#matchesInstanceof(IType)
+        */
+       @Override
+       public FuzzyBoolean matchesInstanceof(ResolvedType type) {
+               return FuzzyBoolean.YES;
+       }
+
+       @Override
+       public void write(CompressingDataOutputStream s) throws IOException {
+               s.writeByte(ANY_KEY);
+       }
+
+       /**
+        * @see org.aspectj.weaver.patterns.TypePattern#matches(IType, MatchKind)
+        */
+       // public FuzzyBoolean matches(IType type, MatchKind kind) {
+       // return FuzzyBoolean.YES;
+       // }
+       /**
+        * @see org.aspectj.weaver.patterns.TypePattern#matchesSubtypes(IType)
+        */
+       @Override
+       protected boolean matchesSubtypes(ResolvedType type) {
+               return true;
+       }
+
+       @Override
+       public boolean isStar() {
+               return true;
+       }
+
+       @Override
+       public String toString() {
+               return "*";
+       }
+
+       @Override
+       public boolean equals(Object obj) {
+               return (obj instanceof AnyTypePattern);
+       }
+
+       @Override
+       public int hashCode() {
+               return 37;
+       }
+
+       @Override
+       public Object accept(PatternNodeVisitor visitor, Object data) {
+               return visitor.visit(this, data);
+       }
+
+       @Override
+       public TypePattern parameterizeWith(Map arg0, World w) {
+               return this;
+       }
+}
\ No newline at end of file
diff --git a/org.aspectj.matcher/src/org/aspectj/weaver/patterns/AnyWithAnnotationTypePattern.java b/org.aspectj.matcher/src/org/aspectj/weaver/patterns/AnyWithAnnotationTypePattern.java
new file mode 100644 (file)
index 0000000..fa154f3
--- /dev/null
@@ -0,0 +1,142 @@
+/* *******************************************************************
+ * Copyright (c) 2002, 2010 Palo Alto Research Center, Incorporated (PARC) and others.
+ * 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://www.eclipse.org/legal/epl-v10.html 
+ *  
+ * Contributors: 
+ *     PARC     initial implementation 
+ * ******************************************************************/
+package org.aspectj.weaver.patterns;
+
+import java.io.IOException;
+import java.lang.reflect.Modifier;
+import java.util.Map;
+
+import org.aspectj.bridge.MessageUtil;
+import org.aspectj.util.FuzzyBoolean;
+import org.aspectj.weaver.CompressingDataOutputStream;
+import org.aspectj.weaver.ISourceContext;
+import org.aspectj.weaver.ResolvedType;
+import org.aspectj.weaver.VersionedDataInputStream;
+import org.aspectj.weaver.WeaverMessages;
+import org.aspectj.weaver.World;
+
+
+/**
+ * This type represents a type pattern of '*' but with an annotation specified, e.g. '@Color *'
+ */
+public class AnyWithAnnotationTypePattern extends TypePattern {
+
+       public AnyWithAnnotationTypePattern(AnnotationTypePattern atp) {
+               super(false, false);
+               annotationPattern = atp;
+       }
+
+       @Override
+       public Object accept(PatternNodeVisitor visitor, Object data) {
+               return visitor.visit(this, data);
+       }
+
+       @Override
+       protected boolean couldEverMatchSameTypesAs(TypePattern other) {
+               return true;
+       }
+
+       @Override
+       protected boolean matchesExactly(ResolvedType type) {
+               annotationPattern.resolve(type.getWorld());
+               boolean b = false;
+               if (type.temporaryAnnotationTypes != null) {
+                       b = annotationPattern.matches(type, type.temporaryAnnotationTypes).alwaysTrue();
+               } else {
+                       b = annotationPattern.matches(type).alwaysTrue();
+               }
+               return b;
+       }
+
+       @Override
+       public TypePattern resolveBindings(IScope scope, Bindings bindings, boolean allowBinding, boolean requireExactType) {
+               if (requireExactType) {
+                       scope.getWorld().getMessageHandler().handleMessage(
+                                       MessageUtil.error(WeaverMessages.format(WeaverMessages.WILDCARD_NOT_ALLOWED), getSourceLocation()));
+                       return NO;
+               }
+               return super.resolveBindings(scope, bindings, allowBinding, requireExactType);
+       }
+
+       @Override
+       protected boolean matchesExactly(ResolvedType type, ResolvedType annotatedType) {
+               annotationPattern.resolve(type.getWorld());
+               return annotationPattern.matches(annotatedType).alwaysTrue();
+       }
+
+       @Override
+       public FuzzyBoolean matchesInstanceof(ResolvedType type) {
+               if (Modifier.isFinal(type.getModifiers())) {
+                       return FuzzyBoolean.fromBoolean(matchesExactly(type));
+               }
+               return FuzzyBoolean.MAYBE;
+       }
+
+       @Override
+       public TypePattern parameterizeWith(Map typeVariableMap, World w) {
+               AnyWithAnnotationTypePattern ret = new AnyWithAnnotationTypePattern(this.annotationPattern.parameterizeWith(
+                               typeVariableMap, w));
+               ret.copyLocationFrom(this);
+               return ret;
+       }
+
+       @Override
+       public void write(CompressingDataOutputStream s) throws IOException {
+               s.writeByte(TypePattern.ANY_WITH_ANNO);
+               annotationPattern.write(s);
+               writeLocation(s);
+       }
+
+       public static TypePattern read(VersionedDataInputStream s, ISourceContext c) throws IOException {
+               AnnotationTypePattern annPatt = AnnotationTypePattern.read(s, c);
+               AnyWithAnnotationTypePattern ret = new AnyWithAnnotationTypePattern(annPatt);
+               ret.readLocation(c, s);
+               return ret;
+       }
+
+       // public FuzzyBoolean matches(IType type, MatchKind kind) {
+       // return FuzzyBoolean.YES;
+       // }
+
+       @Override
+       protected boolean matchesSubtypes(ResolvedType type) {
+               return true;
+       }
+
+       @Override
+       public boolean isStar() {
+               return false;
+       }
+
+       @Override
+       public String toString() {
+               return "(" + annotationPattern + " *)";
+       }
+       
+       public AnnotationTypePattern getAnnotationTypePattern() {
+               return annotationPattern;
+       }
+
+       @Override
+       public boolean equals(Object obj) {
+               if (!(obj instanceof AnyWithAnnotationTypePattern)) {
+                       return false;
+               }
+               AnyWithAnnotationTypePattern awatp = (AnyWithAnnotationTypePattern) obj;
+               return (annotationPattern.equals(awatp.annotationPattern));
+       }
+
+       @Override
+       public int hashCode() {
+               return annotationPattern.hashCode();
+       }
+}
index c24e779be7a040a8b2373637952d19fc8147f4de..c0d5434ef0146687fe126d73c0df7d01f53c9811 100644 (file)
@@ -1,5 +1,5 @@
 /* *******************************************************************
- * Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC).
+ * Copyright (c) 2002, 2010 Palo Alto Research Center, Incorporated (PARC).
  * All rights reserved. 
  * This program and the accompanying materials are made available 
  * under the terms of the Eclipse Public License v1.0 
@@ -8,6 +8,7 @@
  *  
  * Contributors: 
  *     PARC     initial implementation 
+ *     Nieraj Singh
  * ******************************************************************/
 
 package org.aspectj.weaver.patterns;
@@ -25,6 +26,7 @@ import org.aspectj.weaver.World;
 
 public class BindingTypePattern extends ExactTypePattern implements BindingPattern {
        private int formalIndex;
+       private String bindingName;
 
        public BindingTypePattern(UnresolvedType type, int index, boolean isVarArgs) {
                super(type, false, isVarArgs);
@@ -33,11 +35,16 @@ public class BindingTypePattern extends ExactTypePattern implements BindingPatte
 
        public BindingTypePattern(FormalBinding binding, boolean isVarArgs) {
                this(binding.getType(), binding.getIndex(), isVarArgs);
+               this.bindingName = binding.getName();
        }
 
        public int getFormalIndex() {
                return formalIndex;
        }
+       
+       public String getBindingName() {
+               return bindingName;
+       }
 
        public boolean equals(Object other) {
                if (!(other instanceof BindingTypePattern)) {
diff --git a/org.aspectj.matcher/src/org/aspectj/weaver/patterns/EllipsisTypePattern.java b/org.aspectj.matcher/src/org/aspectj/weaver/patterns/EllipsisTypePattern.java
new file mode 100644 (file)
index 0000000..2abc513
--- /dev/null
@@ -0,0 +1,109 @@
+/* *******************************************************************
+ * Copyright (c) 2002, 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://www.eclipse.org/legal/epl-v10.html 
+ *  
+ * Contributors: 
+ *     PARC     initial implementation 
+ * ******************************************************************/
+package org.aspectj.weaver.patterns;
+
+import java.io.IOException;
+import java.util.Map;
+
+import org.aspectj.util.FuzzyBoolean;
+import org.aspectj.weaver.CompressingDataOutputStream;
+import org.aspectj.weaver.ResolvedType;
+import org.aspectj.weaver.World;
+
+public class EllipsisTypePattern extends TypePattern {
+
+       /**
+        * Constructor for EllipsisTypePattern.
+        * 
+        * @param includeSubtypes
+        */
+       public EllipsisTypePattern() {
+               super(false, false, new TypePatternList());
+       }
+
+       /*
+        * (non-Javadoc)
+        * 
+        * @see org.aspectj.weaver.patterns.TypePattern#couldEverMatchSameTypesAs(org.aspectj.weaver.patterns.TypePattern)
+        */
+       @Override
+       protected boolean couldEverMatchSameTypesAs(TypePattern other) {
+               return true;
+       }
+
+       /**
+        * @see org.aspectj.weaver.patterns.TypePattern#matchesExactly(IType)
+        */
+       @Override
+       protected boolean matchesExactly(ResolvedType type) {
+               return false;
+       }
+
+       @Override
+       protected boolean matchesExactly(ResolvedType type, ResolvedType annotatedType) {
+               return false;
+       }
+
+       /**
+        * @see org.aspectj.weaver.patterns.TypePattern#matchesInstanceof(IType)
+        */
+       @Override
+       public FuzzyBoolean matchesInstanceof(ResolvedType type) {
+               return FuzzyBoolean.NO;
+       }
+
+       @Override
+       public void write(CompressingDataOutputStream s) throws IOException {
+               s.writeByte(ELLIPSIS_KEY);
+       }
+
+       @Override
+       public boolean isEllipsis() {
+               return true;
+       }
+
+       @Override
+       public String toString() {
+               return "..";
+       }
+
+       /*
+        * (non-Javadoc)
+        * 
+        * @see java.lang.Object#equals(java.lang.Object)
+        */
+       @Override
+       public boolean equals(Object obj) {
+               return (obj instanceof EllipsisTypePattern);
+       }
+
+       /*
+        * (non-Javadoc)
+        * 
+        * @see java.lang.Object#hashCode()
+        */
+       @Override
+       public int hashCode() {
+               return 17 * 37;
+       }
+
+       @Override
+       public Object accept(PatternNodeVisitor visitor, Object data) {
+               return visitor.visit(this, data);
+       }
+
+       @Override
+       public TypePattern parameterizeWith(Map typeVariableMap, World w) {
+               return this;
+       }
+
+}
\ No newline at end of file
index c0715c857039ad0efa36f2be62e7799b70225b3d..43a7582afb2c73a9044bb469fe5cfe40d969582e 100644 (file)
@@ -8,6 +8,7 @@
  *  
  * Contributors: 
  *   Adrian Colyer                     Initial implementation
+ *   Nieraj Singh
  * ******************************************************************/
 package org.aspectj.weaver.patterns;
 
@@ -49,6 +50,10 @@ public class HasMemberTypePattern extends TypePattern {
                        return hasMethod(type);
                }
        }
+       
+       public ISignaturePattern getSignaturePattern() {
+               return signaturePattern;
+       }
 
        private final static String declareAtPrefix = "ajc$declare_at";
 
diff --git a/org.aspectj.matcher/src/org/aspectj/weaver/patterns/NoTypePattern.java b/org.aspectj.matcher/src/org/aspectj/weaver/patterns/NoTypePattern.java
new file mode 100644 (file)
index 0000000..26dacba
--- /dev/null
@@ -0,0 +1,117 @@
+/* *******************************************************************
+ * Copyright (c) 2002, 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://www.eclipse.org/legal/epl-v10.html 
+ *  
+ * Contributors: 
+ *     PARC     initial implementation 
+ * ******************************************************************/
+package org.aspectj.weaver.patterns;
+
+import java.io.IOException;
+import java.util.Map;
+
+import org.aspectj.util.FuzzyBoolean;
+import org.aspectj.weaver.CompressingDataOutputStream;
+import org.aspectj.weaver.ResolvedType;
+import org.aspectj.weaver.World;
+
+public class NoTypePattern extends TypePattern {
+
+       public NoTypePattern() {
+               super(false, false, new TypePatternList());
+       }
+
+       /*
+        * (non-Javadoc)
+        * 
+        * @see org.aspectj.weaver.patterns.TypePattern#couldEverMatchSameTypesAs(org.aspectj.weaver.patterns.TypePattern)
+        */
+       @Override
+       protected boolean couldEverMatchSameTypesAs(TypePattern other) {
+               return false;
+       }
+
+       /**
+        * @see org.aspectj.weaver.patterns.TypePattern#matchesExactly(IType)
+        */
+       @Override
+       protected boolean matchesExactly(ResolvedType type) {
+               return false;
+       }
+
+       @Override
+       protected boolean matchesExactly(ResolvedType type, ResolvedType annotatedType) {
+               return false;
+       }
+
+       /**
+        * @see org.aspectj.weaver.patterns.TypePattern#matchesInstanceof(IType)
+        */
+       @Override
+       public FuzzyBoolean matchesInstanceof(ResolvedType type) {
+               return FuzzyBoolean.NO;
+       }
+
+       @Override
+       public void write(CompressingDataOutputStream s) throws IOException {
+               s.writeByte(NO_KEY);
+       }
+
+       /**
+        * @see org.aspectj.weaver.patterns.TypePattern#matches(IType, MatchKind)
+        */
+       // public FuzzyBoolean matches(IType type, MatchKind kind) {
+       // return FuzzyBoolean.YES;
+       // }
+       /**
+        * @see org.aspectj.weaver.patterns.TypePattern#matchesSubtypes(IType)
+        */
+       @Override
+       protected boolean matchesSubtypes(ResolvedType type) {
+               return false;
+       }
+
+       @Override
+       public boolean isStar() {
+               return false;
+       }
+
+       @Override
+       public String toString() {
+               return "<nothing>";
+       }// FIXME AV - bad! toString() cannot be parsed back (not idempotent)
+
+       /*
+        * (non-Javadoc)
+        * 
+        * @see java.lang.Object#equals(java.lang.Object)
+        */
+       @Override
+       public boolean equals(Object obj) {
+               return (obj instanceof NoTypePattern);
+       }
+
+       /*
+        * (non-Javadoc)
+        * 
+        * @see java.lang.Object#hashCode()
+        */
+       @Override
+       public int hashCode() {
+               return 17 * 37 * 37;
+       }
+
+       @Override
+       public Object accept(PatternNodeVisitor visitor, Object data) {
+               return visitor.visit(this, data);
+       }
+
+       @Override
+       public TypePattern parameterizeWith(Map arg0, World w) {
+               return this;
+       }
+}
index beffd131e5d5ab79e95fcc94b67fe3a70b545cbe..3e0934fe8a5ea4d654da837b007fe8647e2029f1 100644 (file)
@@ -5,6 +5,10 @@
  * under the terms of the Eclipse Public License v1.0 
  * which accompanies this distribution and is available at 
  * http://www.eclipse.org/legal/epl-v10.html 
+ * 
+ * Contributors:
+ *     Andy Clement
+ *     Nieraj Singh
  * ******************************************************************/
 
 package org.aspectj.weaver.patterns;
@@ -44,6 +48,10 @@ public class TypeCategoryTypePattern extends TypePattern {
                super(false);
                this.category = category;
        }
+       
+       public int getTypeCategory() {
+               return category;
+       }
 
        @Override
        protected boolean matchesExactly(ResolvedType type) {
index 023a259de8eb28f2b1f769d29f0948ba3717245a..9e091301a9c7b1eba5d32be9137997c7ec689b6f 100644 (file)
@@ -1,5 +1,5 @@
 /* *******************************************************************
- * Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC).
+ * Copyright (c) 2002, 2010 Palo Alto Research Center, Incorporated (PARC).
  * All rights reserved. 
  * This program and the accompanying materials are made available 
  * under the terms of the Eclipse Public License v1.0 
@@ -8,19 +8,18 @@
  *  
  * Contributors: 
  *     PARC     initial implementation 
+ *     Nieraj Singh
  * ******************************************************************/
 
 package org.aspectj.weaver.patterns;
 
 import java.io.IOException;
-import java.lang.reflect.Modifier;
 import java.util.Iterator;
 import java.util.Map;
 
 import org.aspectj.bridge.MessageUtil;
 import org.aspectj.util.FuzzyBoolean;
 import org.aspectj.weaver.BCException;
-import org.aspectj.weaver.CompressingDataOutputStream;
 import org.aspectj.weaver.ISourceContext;
 import org.aspectj.weaver.IntMap;
 import org.aspectj.weaver.ResolvedType;
@@ -357,392 +356,5 @@ public abstract class TypePattern extends PatternNode {
 
 }
 
-class EllipsisTypePattern extends TypePattern {
 
-       /**
-        * Constructor for EllipsisTypePattern.
-        * 
-        * @param includeSubtypes
-        */
-       public EllipsisTypePattern() {
-               super(false, false, new TypePatternList());
-       }
-
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.aspectj.weaver.patterns.TypePattern#couldEverMatchSameTypesAs(org.aspectj.weaver.patterns.TypePattern)
-        */
-       @Override
-       protected boolean couldEverMatchSameTypesAs(TypePattern other) {
-               return true;
-       }
-
-       /**
-        * @see org.aspectj.weaver.patterns.TypePattern#matchesExactly(IType)
-        */
-       @Override
-       protected boolean matchesExactly(ResolvedType type) {
-               return false;
-       }
-
-       @Override
-       protected boolean matchesExactly(ResolvedType type, ResolvedType annotatedType) {
-               return false;
-       }
-
-       /**
-        * @see org.aspectj.weaver.patterns.TypePattern#matchesInstanceof(IType)
-        */
-       @Override
-       public FuzzyBoolean matchesInstanceof(ResolvedType type) {
-               return FuzzyBoolean.NO;
-       }
-
-       @Override
-       public void write(CompressingDataOutputStream s) throws IOException {
-               s.writeByte(ELLIPSIS_KEY);
-       }
-
-       @Override
-       public boolean isEllipsis() {
-               return true;
-       }
-
-       @Override
-       public String toString() {
-               return "..";
-       }
-
-       /*
-        * (non-Javadoc)
-        * 
-        * @see java.lang.Object#equals(java.lang.Object)
-        */
-       @Override
-       public boolean equals(Object obj) {
-               return (obj instanceof EllipsisTypePattern);
-       }
-
-       /*
-        * (non-Javadoc)
-        * 
-        * @see java.lang.Object#hashCode()
-        */
-       @Override
-       public int hashCode() {
-               return 17 * 37;
-       }
-
-       @Override
-       public Object accept(PatternNodeVisitor visitor, Object data) {
-               return visitor.visit(this, data);
-       }
-
-       @Override
-       public TypePattern parameterizeWith(Map typeVariableMap, World w) {
-               return this;
-       }
-
-}
-
-class AnyTypePattern extends TypePattern {
-
-       /**
-        * Constructor for EllipsisTypePattern.
-        * 
-        * @param includeSubtypes
-        */
-       public AnyTypePattern() {
-               super(false, false, new TypePatternList());
-       }
-
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.aspectj.weaver.patterns.TypePattern#couldEverMatchSameTypesAs(org.aspectj.weaver.patterns.TypePattern)
-        */
-       @Override
-       protected boolean couldEverMatchSameTypesAs(TypePattern other) {
-               return true;
-       }
-
-       /**
-        * @see org.aspectj.weaver.patterns.TypePattern#matchesExactly(IType)
-        */
-       @Override
-       protected boolean matchesExactly(ResolvedType type) {
-               return true;
-       }
-
-       @Override
-       protected boolean matchesExactly(ResolvedType type, ResolvedType annotatedType) {
-               return true;
-       }
-
-       /**
-        * @see org.aspectj.weaver.patterns.TypePattern#matchesInstanceof(IType)
-        */
-       @Override
-       public FuzzyBoolean matchesInstanceof(ResolvedType type) {
-               return FuzzyBoolean.YES;
-       }
-
-       @Override
-       public void write(CompressingDataOutputStream s) throws IOException {
-               s.writeByte(ANY_KEY);
-       }
-
-       /**
-        * @see org.aspectj.weaver.patterns.TypePattern#matches(IType, MatchKind)
-        */
-       // public FuzzyBoolean matches(IType type, MatchKind kind) {
-       // return FuzzyBoolean.YES;
-       // }
-       /**
-        * @see org.aspectj.weaver.patterns.TypePattern#matchesSubtypes(IType)
-        */
-       @Override
-       protected boolean matchesSubtypes(ResolvedType type) {
-               return true;
-       }
-
-       @Override
-       public boolean isStar() {
-               return true;
-       }
-
-       @Override
-       public String toString() {
-               return "*";
-       }
-
-       @Override
-       public boolean equals(Object obj) {
-               return (obj instanceof AnyTypePattern);
-       }
-
-       @Override
-       public int hashCode() {
-               return 37;
-       }
-
-       @Override
-       public Object accept(PatternNodeVisitor visitor, Object data) {
-               return visitor.visit(this, data);
-       }
-
-       @Override
-       public TypePattern parameterizeWith(Map arg0, World w) {
-               return this;
-       }
-}
-
-/**
- * This type represents a type pattern of '*' but with an annotation specified, e.g. '@Color *'
- */
-class AnyWithAnnotationTypePattern extends TypePattern {
-
-       public AnyWithAnnotationTypePattern(AnnotationTypePattern atp) {
-               super(false, false);
-               annotationPattern = atp;
-       }
-
-       @Override
-       public Object accept(PatternNodeVisitor visitor, Object data) {
-               return visitor.visit(this, data);
-       }
-
-       @Override
-       protected boolean couldEverMatchSameTypesAs(TypePattern other) {
-               return true;
-       }
-
-       @Override
-       protected boolean matchesExactly(ResolvedType type) {
-               annotationPattern.resolve(type.getWorld());
-               boolean b = false;
-               if (type.temporaryAnnotationTypes != null) {
-                       b = annotationPattern.matches(type, type.temporaryAnnotationTypes).alwaysTrue();
-               } else {
-                       b = annotationPattern.matches(type).alwaysTrue();
-               }
-               return b;
-       }
-
-       @Override
-       public TypePattern resolveBindings(IScope scope, Bindings bindings, boolean allowBinding, boolean requireExactType) {
-               if (requireExactType) {
-                       scope.getWorld().getMessageHandler().handleMessage(
-                                       MessageUtil.error(WeaverMessages.format(WeaverMessages.WILDCARD_NOT_ALLOWED), getSourceLocation()));
-                       return NO;
-               }
-               return super.resolveBindings(scope, bindings, allowBinding, requireExactType);
-       }
-
-       @Override
-       protected boolean matchesExactly(ResolvedType type, ResolvedType annotatedType) {
-               annotationPattern.resolve(type.getWorld());
-               return annotationPattern.matches(annotatedType).alwaysTrue();
-       }
-
-       @Override
-       public FuzzyBoolean matchesInstanceof(ResolvedType type) {
-               if (Modifier.isFinal(type.getModifiers())) {
-                       return FuzzyBoolean.fromBoolean(matchesExactly(type));
-               }
-               return FuzzyBoolean.MAYBE;
-       }
-
-       @Override
-       public TypePattern parameterizeWith(Map typeVariableMap, World w) {
-               AnyWithAnnotationTypePattern ret = new AnyWithAnnotationTypePattern(this.annotationPattern.parameterizeWith(
-                               typeVariableMap, w));
-               ret.copyLocationFrom(this);
-               return ret;
-       }
-
-       @Override
-       public void write(CompressingDataOutputStream s) throws IOException {
-               s.writeByte(TypePattern.ANY_WITH_ANNO);
-               annotationPattern.write(s);
-               writeLocation(s);
-       }
 
-       public static TypePattern read(VersionedDataInputStream s, ISourceContext c) throws IOException {
-               AnnotationTypePattern annPatt = AnnotationTypePattern.read(s, c);
-               AnyWithAnnotationTypePattern ret = new AnyWithAnnotationTypePattern(annPatt);
-               ret.readLocation(c, s);
-               return ret;
-       }
-
-       // public FuzzyBoolean matches(IType type, MatchKind kind) {
-       // return FuzzyBoolean.YES;
-       // }
-
-       @Override
-       protected boolean matchesSubtypes(ResolvedType type) {
-               return true;
-       }
-
-       @Override
-       public boolean isStar() {
-               return false;
-       }
-
-       @Override
-       public String toString() {
-               return "(" + annotationPattern + " *)";
-       }
-
-       @Override
-       public boolean equals(Object obj) {
-               if (!(obj instanceof AnyWithAnnotationTypePattern)) {
-                       return false;
-               }
-               AnyWithAnnotationTypePattern awatp = (AnyWithAnnotationTypePattern) obj;
-               return (annotationPattern.equals(awatp.annotationPattern));
-       }
-
-       @Override
-       public int hashCode() {
-               return annotationPattern.hashCode();
-       }
-}
-
-class NoTypePattern extends TypePattern {
-
-       public NoTypePattern() {
-               super(false, false, new TypePatternList());
-       }
-
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.aspectj.weaver.patterns.TypePattern#couldEverMatchSameTypesAs(org.aspectj.weaver.patterns.TypePattern)
-        */
-       @Override
-       protected boolean couldEverMatchSameTypesAs(TypePattern other) {
-               return false;
-       }
-
-       /**
-        * @see org.aspectj.weaver.patterns.TypePattern#matchesExactly(IType)
-        */
-       @Override
-       protected boolean matchesExactly(ResolvedType type) {
-               return false;
-       }
-
-       @Override
-       protected boolean matchesExactly(ResolvedType type, ResolvedType annotatedType) {
-               return false;
-       }
-
-       /**
-        * @see org.aspectj.weaver.patterns.TypePattern#matchesInstanceof(IType)
-        */
-       @Override
-       public FuzzyBoolean matchesInstanceof(ResolvedType type) {
-               return FuzzyBoolean.NO;
-       }
-
-       @Override
-       public void write(CompressingDataOutputStream s) throws IOException {
-               s.writeByte(NO_KEY);
-       }
-
-       /**
-        * @see org.aspectj.weaver.patterns.TypePattern#matches(IType, MatchKind)
-        */
-       // public FuzzyBoolean matches(IType type, MatchKind kind) {
-       // return FuzzyBoolean.YES;
-       // }
-       /**
-        * @see org.aspectj.weaver.patterns.TypePattern#matchesSubtypes(IType)
-        */
-       @Override
-       protected boolean matchesSubtypes(ResolvedType type) {
-               return false;
-       }
-
-       @Override
-       public boolean isStar() {
-               return false;
-       }
-
-       @Override
-       public String toString() {
-               return "<nothing>";
-       }// FIXME AV - bad! toString() cannot be parsed back (not idempotent)
-
-       /*
-        * (non-Javadoc)
-        * 
-        * @see java.lang.Object#equals(java.lang.Object)
-        */
-       @Override
-       public boolean equals(Object obj) {
-               return (obj instanceof NoTypePattern);
-       }
-
-       /*
-        * (non-Javadoc)
-        * 
-        * @see java.lang.Object#hashCode()
-        */
-       @Override
-       public int hashCode() {
-               return 17 * 37 * 37;
-       }
-
-       @Override
-       public Object accept(PatternNodeVisitor visitor, Object data) {
-               return visitor.visit(this, data);
-       }
-
-       @Override
-       public TypePattern parameterizeWith(Map arg0, World w) {
-               return this;
-       }
-}