diff options
author | acolyer <acolyer> | 2005-08-10 11:49:34 +0000 |
---|---|---|
committer | acolyer <acolyer> | 2005-08-10 11:49:34 +0000 |
commit | 5735e966959da60fcacebb23e8b5463c4138020c (patch) | |
tree | 6a1bece75af6525fd45769323d029740598b5387 /weaver | |
parent | dcd86778de51b16e1d4c3922f6f2d2fe594d15b5 (diff) | |
download | aspectj-5735e966959da60fcacebb23e8b5463c4138020c.tar.gz aspectj-5735e966959da60fcacebb23e8b5463c4138020c.zip |
tests and fix for bug pr106461:
"org.aspectj.weaver.patterns.WildTypePattern.maybeGetCleanName(WildTypePattern.java:500)"
Diffstat (limited to 'weaver')
-rw-r--r-- | weaver/src/org/aspectj/weaver/patterns/PatternParser.java | 1 | ||||
-rw-r--r-- | weaver/src/org/aspectj/weaver/patterns/WildTypePattern.java | 5 |
2 files changed, 6 insertions, 0 deletions
diff --git a/weaver/src/org/aspectj/weaver/patterns/PatternParser.java b/weaver/src/org/aspectj/weaver/patterns/PatternParser.java index 69d59cdae..76060b1b6 100644 --- a/weaver/src/org/aspectj/weaver/patterns/PatternParser.java +++ b/weaver/src/org/aspectj/weaver/patterns/PatternParser.java @@ -1111,6 +1111,7 @@ public class PatternParser { name = parseNamePattern(); } else { name = tryToExtractName(declaringType); + if (name == null) throw new ParserException("name pattern",tokenSource.peek()); if (declaringType.toString().equals("")) { declaringType = TypePattern.ANY; } diff --git a/weaver/src/org/aspectj/weaver/patterns/WildTypePattern.java b/weaver/src/org/aspectj/weaver/patterns/WildTypePattern.java index e2f99c0fa..493d82fcc 100644 --- a/weaver/src/org/aspectj/weaver/patterns/WildTypePattern.java +++ b/weaver/src/org/aspectj/weaver/patterns/WildTypePattern.java @@ -455,6 +455,11 @@ public class WildTypePattern extends TypePattern { } public NamePattern extractName() { + if (isIncludeSubtypes() || isVarArgs() || isArray()) { + // we can't extract a name, the pattern is something like Foo+ and therefore + // it is not ok to treat Foo as a method name! + return null; + } //System.err.println("extract from : " + Arrays.asList(namePatterns)); int len = namePatterns.length; NamePattern ret = namePatterns[len-1]; |