]> source.dussan.org Git - aspectj.git/commitdiff
Fix for Bugzilla Bug 67591
authoraclement <aclement>
Thu, 5 Aug 2004 09:25:04 +0000 (09:25 +0000)
committeraclement <aclement>
Thu, 5 Aug 2004 09:25:04 +0000 (09:25 +0000)
   invalid warning indicating no match when a match really occurs

weaver/src/org/aspectj/weaver/patterns/WildTypePattern.java

index 9e33ee393614a07b8f72ca7b56d3fce2f4e0a931..a5d1c42d2d4b502cd82110211f717d2bffb7101c 100644 (file)
@@ -335,15 +335,22 @@ public class WildTypePattern extends TypePattern {
                
                String cleanName = maybeGetCleanName();
                String originalName = cleanName;
+               // if we discover it is 'MISSING' when searching via the scope, this next local var will
+               // tell us if it is really missing or if it does exist in the world and we just can't
+               // see it from the current scope.
+               ResolvedTypeX resolvedTypeInTheWorld = null;
                if (cleanName != null) {
                        TypeX type;
                        
                        //System.out.println("resolve: " + cleanName);
                        //??? this loop has too many inefficiencies to count
+                       resolvedTypeInTheWorld = scope.getWorld().resolve(TypeX.forName(cleanName),true);
                        while ((type = scope.lookupType(cleanName, this)) == ResolvedTypeX.MISSING) {
                                int lastDot = cleanName.lastIndexOf('.');
                                if (lastDot == -1) break;
                                cleanName = cleanName.substring(0, lastDot) + '$' + cleanName.substring(lastDot+1);
+                               if (resolvedTypeInTheWorld == ResolvedTypeX.MISSING)
+                                       resolvedTypeInTheWorld = scope.getWorld().resolve(TypeX.forName(cleanName),true);                                       
                        }
                        if (type == ResolvedTypeX.MISSING) {
                                if (requireExactType) {
@@ -356,7 +363,9 @@ public class WildTypePattern extends TypePattern {
                                        }
                                        return NO;
                                } else if (scope.getWorld().getLint().invalidAbsoluteTypeName.isEnabled()) {
-                                       scope.getWorld().getLint().invalidAbsoluteTypeName.signal(originalName, getSourceLocation());
+                                       // Only put the lint warning out if we can't find it in the world
+                                       if (resolvedTypeInTheWorld == ResolvedTypeX.MISSING)
+                                         scope.getWorld().getLint().invalidAbsoluteTypeName.signal(originalName, getSourceLocation());
                                }
                        } else {
                                if (dim != 0) type = TypeX.makeArray(type, dim);