]> source.dussan.org Git - aspectj.git/commitdiff
see pr112105 comment #13: naughty. made a check configurable.
authoraclement <aclement>
Wed, 26 Oct 2005 16:51:22 +0000 (16:51 +0000)
committeraclement <aclement>
Wed, 26 Oct 2005 16:51:22 +0000 (16:51 +0000)
weaver/src/org/aspectj/weaver/patterns/WildTypePattern.java

index 647090eeb1aec4f5e58f871f4091d295c3a7b925..6a29148c7ab73b8e5d021cd477541bb75c86e1e2 100644 (file)
@@ -90,6 +90,9 @@ public class WildTypePattern extends TypePattern {
        String[] knownMatches;
        int dim;
        
+       // SECRETAPI - just for testing, turns off boundschecking temporarily...
+       public static boolean boundscheckingoff = false;
+       
        // these next three are set if the type pattern is constrained by extends or super clauses, in which case the
        // namePatterns must have length 1
        // TODO AMC: read/write/resolve of these fields
@@ -896,6 +899,15 @@ public class WildTypePattern extends TypePattern {
                
                // now check that each typeParameter pattern, if exact, matches the bounds
                // of the type variable.
+               return checkBoundsOK(scope,genericType,requireExactType);
+               
+               // return true;
+       }
+       
+       public boolean checkBoundsOK(IScope scope,ResolvedType genericType,boolean requireExactType) {
+               if (boundscheckingoff) return true;
+               TypeVariable[] tvs = genericType.getTypeVariables();
+               TypePattern[] typeParamPatterns = typeParameters.getTypePatterns();
                if (typeParameters.areAllExactWithNoSubtypesAllowed()) {
                        for (int i = 0; i < tvs.length; i++) {
                                UnresolvedType ut = typeParamPatterns[i].getExactType();