aboutsummaryrefslogtreecommitdiffstats
path: root/weaver
diff options
context:
space:
mode:
authoraclement <aclement>2006-05-17 10:04:47 +0000
committeraclement <aclement>2006-05-17 10:04:47 +0000
commit7d9a7287ee1aef66ba2edf55ef2fec2bf95b0dc3 (patch)
tree252f0e8910b830fca95be780f59a400bcba8ea9c /weaver
parent4842f1826c3905c2789bc99a2dc841c733092339 (diff)
downloadaspectj-7d9a7287ee1aef66ba2edf55ef2fec2bf95b0dc3.tar.gz
aspectj-7d9a7287ee1aef66ba2edf55ef2fec2bf95b0dc3.zip
fix for 142165: LTW
Diffstat (limited to 'weaver')
-rw-r--r--weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java8
-rw-r--r--weaver/src/org/aspectj/weaver/patterns/PatternParser.java6
2 files changed, 12 insertions, 2 deletions
diff --git a/weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java b/weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
index 9715bcbe2..ed676fde9 100644
--- a/weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
+++ b/weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
@@ -1720,7 +1720,9 @@ public class AtAjAttributes {
*/
private static Pointcut parsePointcut(String pointcutString, AjAttributeStruct struct, boolean allowIf) {
try {
- Pointcut pointcut = new PatternParser(pointcutString, struct.context).parsePointcut();
+ PatternParser parser = new PatternParser(pointcutString, struct.context);
+ Pointcut pointcut = parser.parsePointcut();
+ parser.checkEof();
if (!allowIf && pointcutString.indexOf("if()") >= 0 && hasIf(pointcut)) {
reportError("if() pointcut is not allowed at this pointcut location '" + pointcutString +"'", struct);
return null;
@@ -1728,10 +1730,12 @@ public class AtAjAttributes {
pointcut.setLocation(struct.context, -1, -1);//FIXME -1,-1 is not good enough
return pointcut;
} catch (ParserException e) {
- reportError("Invalid pointcut '" + pointcutString + "': " + e.toString(), struct);
+ reportError("Invalid pointcut '" + pointcutString + "': " + e.toString() +
+ (e.getLocation()==null?"":" at position "+e.getLocation().getStart()), struct);
return null;
}
}
+
private static boolean hasIf(Pointcut pointcut) {
IfFinder visitor = new IfFinder();
diff --git a/weaver/src/org/aspectj/weaver/patterns/PatternParser.java b/weaver/src/org/aspectj/weaver/patterns/PatternParser.java
index 109cc007e..7da0ed739 100644
--- a/weaver/src/org/aspectj/weaver/patterns/PatternParser.java
+++ b/weaver/src/org/aspectj/weaver/patterns/PatternParser.java
@@ -1424,6 +1424,12 @@ public class PatternParser {
return next.getString() == token;
}
+ public void checkEof() {
+ IToken last = tokenSource.next();
+ if (last != IToken.EOF) {
+ throw new ParserException("unexpected pointcut element", last);
+ }
+ }
public PatternParser(String data) {
this(BasicTokenSource.makeTokenSource(data,null));