aboutsummaryrefslogtreecommitdiffstats
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
parent4842f1826c3905c2789bc99a2dc841c733092339 (diff)
downloadaspectj-7d9a7287ee1aef66ba2edf55ef2fec2bf95b0dc3.tar.gz
aspectj-7d9a7287ee1aef66ba2edf55ef2fec2bf95b0dc3.zip
fix for 142165: LTW
-rw-r--r--tests/src/org/aspectj/systemtest/ajc152/Ajc152Tests.java6
-rw-r--r--util/src/org/aspectj/util/LangUtil.java2
-rw-r--r--weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java8
-rw-r--r--weaver/src/org/aspectj/weaver/patterns/PatternParser.java6
4 files changed, 18 insertions, 4 deletions
diff --git a/tests/src/org/aspectj/systemtest/ajc152/Ajc152Tests.java b/tests/src/org/aspectj/systemtest/ajc152/Ajc152Tests.java
index 460be02cd..43d163ae4 100644
--- a/tests/src/org/aspectj/systemtest/ajc152/Ajc152Tests.java
+++ b/tests/src/org/aspectj/systemtest/ajc152/Ajc152Tests.java
@@ -16,7 +16,11 @@ import junit.framework.Test;
import org.aspectj.testing.XMLBasedAjcTestCase;
public class Ajc152Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
-
+
+// public void testMisbehavingDeclareAnnotation_pr135865() { runTest("misbehaving declare annotation");}
+ public void testCompletelyBrokenAopConcretization_pr142165_1() { runTest("broken concretization");}
+ public void testCompletelyBrokenAopConcretization_pr142165_2() { runTest("broken concretization - 2");}
+ public void testCompletelyBrokenAopConcretization_pr142165_3() { runTest("broken concretization - 3");}
public void testVerifyErrorLTW_pr135068() { runTest("ltw verifyerror");}
public void testVerifyErrorLTW_pr135068_2() { runTest("ltw verifyerror - 2");}
public void testVerifyErrorLTW_pr135068_3() { runTest("ltw verifyerror - 3");}
diff --git a/util/src/org/aspectj/util/LangUtil.java b/util/src/org/aspectj/util/LangUtil.java
index fa831c457..7350386ac 100644
--- a/util/src/org/aspectj/util/LangUtil.java
+++ b/util/src/org/aspectj/util/LangUtil.java
@@ -710,7 +710,7 @@ public class LangUtil {
while (-1 != (loc = in.indexOf(sought, start))) {
result.append(in.substring(start, loc));
if (!LangUtil.isEmpty(replace)) {
- result.append(in.substring(start, loc));
+ result.append(replace);
}
start = loc + len;
}
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));