From: aclement Date: Thu, 5 Aug 2004 09:25:04 +0000 (+0000) Subject: Fix for Bugzilla Bug 67591 X-Git-Tag: for_ajdt1_1_12~45 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=81b5b1d6d34d5277d6595b5810300d6b8cd7f833;p=aspectj.git Fix for Bugzilla Bug 67591 invalid warning indicating no match when a match really occurs --- diff --git a/weaver/src/org/aspectj/weaver/patterns/WildTypePattern.java b/weaver/src/org/aspectj/weaver/patterns/WildTypePattern.java index 9e33ee393..a5d1c42d2 100644 --- a/weaver/src/org/aspectj/weaver/patterns/WildTypePattern.java +++ b/weaver/src/org/aspectj/weaver/patterns/WildTypePattern.java @@ -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);