]> source.dussan.org Git - aspectj.git/commitdiff
generics
authoraclement <aclement>
Sat, 7 Nov 2009 00:33:25 +0000 (00:33 +0000)
committeraclement <aclement>
Sat, 7 Nov 2009 00:33:25 +0000 (00:33 +0000)
org.aspectj.matcher/src/org/aspectj/weaver/patterns/NotTypePattern.java

index 5ade60e450b1b897a9c6ec3512fbff223b7c63eb..01adce402e9787873ab90816af05af1bf3499d43 100644 (file)
@@ -10,7 +10,6 @@
  *     PARC     initial implementation 
  * ******************************************************************/
 
-
 package org.aspectj.weaver.patterns;
 
 import java.io.DataOutputStream;
@@ -27,90 +26,95 @@ import org.aspectj.weaver.World;
 /**
  * !TypePattern
  * 
- * <p>any binding to formals is explicitly forbidden for any composite, ! is
- * just the most obviously wrong case.
+ * <p>
+ * any binding to formals is explicitly forbidden for any composite, ! is just the most obviously wrong case.
  * 
  * @author Erik Hilsdale
  * @author Jim Hugunin
  */
 public class NotTypePattern extends TypePattern {
        private TypePattern negatedPattern;
-       
+
        public NotTypePattern(TypePattern pattern) {
-               super(false,false);  //??? we override all methods that care about includeSubtypes
+               super(false, false); // ??? we override all methods that care about includeSubtypes
                this.negatedPattern = pattern;
                setLocation(pattern.getSourceContext(), pattern.getStart(), pattern.getEnd());
        }
 
-    public TypePattern getNegatedPattern() {
-        return negatedPattern;
-    }
+       public TypePattern getNegatedPattern() {
+               return negatedPattern;
+       }
 
-       /* (non-Javadoc)
-        * @see org.aspectj.weaver.patterns.TypePattern#couldEverMatchSameTypesAs(org.aspectj.weaver.patterns.TypePattern)
-        */
+       @Override
        protected boolean couldEverMatchSameTypesAs(TypePattern other) {
                return true;
        }
-       
+
+       @Override
        public FuzzyBoolean matchesInstanceof(ResolvedType type) {
                return negatedPattern.matchesInstanceof(type).not();
        }
 
+       @Override
        protected boolean matchesExactly(ResolvedType type) {
                return (!negatedPattern.matchesExactly(type) && annotationPattern.matches(type).alwaysTrue());
        }
-       
+
+       @Override
        protected boolean matchesExactly(ResolvedType type, ResolvedType annotatedType) {
-               return (!negatedPattern.matchesExactly(type,annotatedType) && annotationPattern.matches(annotatedType).alwaysTrue());
+               return (!negatedPattern.matchesExactly(type, annotatedType) && annotationPattern.matches(annotatedType).alwaysTrue());
        }
-               
+
+       @Override
        public boolean matchesStatically(ResolvedType type) {
                return !negatedPattern.matchesStatically(type);
        }
-       
+
+       @Override
        public void setAnnotationTypePattern(AnnotationTypePattern annPatt) {
                super.setAnnotationTypePattern(annPatt);
        }
-       
+
+       @Override
        public void setIsVarArgs(boolean isVarArgs) {
                negatedPattern.setIsVarArgs(isVarArgs);
        }
-       
-       
+
+       @Override
        public void write(DataOutputStream s) throws IOException {
                s.writeByte(TypePattern.NOT);
                negatedPattern.write(s);
                annotationPattern.write(s);
                writeLocation(s);
        }
-       
+
        public static TypePattern read(VersionedDataInputStream s, ISourceContext context) throws IOException {
                TypePattern ret = new NotTypePattern(TypePattern.read(s, context));
-               if (s.getMajorVersion()>=AjAttribute.WeaverVersionInfo.WEAVER_VERSION_MAJOR_AJ150) {
-                       ret.annotationPattern = AnnotationTypePattern.read(s,context);
+               if (s.getMajorVersion() >= AjAttribute.WeaverVersionInfo.WEAVER_VERSION_MAJOR_AJ150) {
+                       ret.annotationPattern = AnnotationTypePattern.read(s, context);
                }
                ret.readLocation(context, s);
                return ret;
        }
 
-       public TypePattern resolveBindings(
-               IScope scope,
-               Bindings bindings,
-               boolean allowBinding, boolean requireExactType)
-       {
-               if (requireExactType) return notExactType(scope);
+       @Override
+       public TypePattern resolveBindings(IScope scope, Bindings bindings, boolean allowBinding, boolean requireExactType) {
+               if (requireExactType) {
+                       return notExactType(scope);
+               }
                negatedPattern = negatedPattern.resolveBindings(scope, bindings, false, false);
                return this;
        }
-       
-       public TypePattern parameterizeWith(Map typeVariableMap,World w) {
-               TypePattern newNegatedPattern = negatedPattern.parameterizeWith(typeVariableMap,w);
+
+       @Override
+       public TypePattern parameterizeWith(Map typeVariableMap, World w) {
+               TypePattern newNegatedPattern = negatedPattern.parameterizeWith(typeVariableMap, w);
                NotTypePattern ret = new NotTypePattern(newNegatedPattern);
                ret.copyLocationFrom(this);
                return ret;
        }
-       
+
+       @Override
        public String toString() {
                StringBuffer buff = new StringBuffer();
                if (annotationPattern != AnnotationTypePattern.ANY) {
@@ -125,28 +129,38 @@ public class NotTypePattern extends TypePattern {
                }
                return buff.toString();
        }
-       
-       /* (non-Javadoc)
+
+       /*
+        * (non-Javadoc)
+        * 
         * @see java.lang.Object#equals(java.lang.Object)
         */
+       @Override
        public boolean equals(Object obj) {
-               if (! (obj instanceof NotTypePattern)) return false;
-               return (negatedPattern.equals(((NotTypePattern)obj).negatedPattern));
+               if (!(obj instanceof NotTypePattern)) {
+                       return false;
+               }
+               return (negatedPattern.equals(((NotTypePattern) obj).negatedPattern));
        }
-       
-       /* (non-Javadoc)
+
+       /*
+        * (non-Javadoc)
+        * 
         * @see java.lang.Object#hashCode()
         */
+       @Override
        public int hashCode() {
                return 17 + 37 * negatedPattern.hashCode();
        }
 
-    public Object accept(PatternNodeVisitor visitor, Object data) {
-        return visitor.visit(this, data);
-    }
-       
+       @Override
+       public Object accept(PatternNodeVisitor visitor, Object data) {
+               return visitor.visit(this, data);
+       }
+
+       @Override
        public Object traverse(PatternNodeVisitor visitor, Object data) {
-               Object ret = accept(visitor,data);
+               Object ret = accept(visitor, data);
                negatedPattern.traverse(visitor, ret);
                return ret;
        }