diff options
author | acolyer <acolyer> | 2005-08-19 19:51:32 +0000 |
---|---|---|
committer | acolyer <acolyer> | 2005-08-19 19:51:32 +0000 |
commit | 93fdce17441da20b66f6db665db9d9272adda09c (patch) | |
tree | fcf5af19f7ecc443651b8aa90b1c466d6ea46402 | |
parent | 7b325703558284f5dbf21c5e94b1ffc76e4e382c (diff) | |
download | aspectj-93fdce17441da20b66f6db665db9d9272adda09c.tar.gz aspectj-93fdce17441da20b66f6db665db9d9272adda09c.zip |
fix and test case for pr79523: BCException: illegal change to pointcut declaration: calls(<nothing>)
4 files changed, 19 insertions, 1 deletions
diff --git a/tests/bugs150/pr79523.aj b/tests/bugs150/pr79523.aj new file mode 100644 index 000000000..6456b002c --- /dev/null +++ b/tests/bugs150/pr79523.aj @@ -0,0 +1,6 @@ +public aspect pr79523 { + + pointcut someCalls(String str) : call(*.new(String)) && args(str); + declare warning : someCalls(str) : "not allowed"; // CE L 4 + +}
\ No newline at end of file diff --git a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java index cfd7a5fc3..5827bc445 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java @@ -246,6 +246,10 @@ public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase { runTest("@SuppressWarnings should suppress"); } + public void testDEOWWithBindingPointcut() { + runTest("declare warning : foo(str) : ...;"); + } + // helper methods..... public SyntheticRepository createRepos(File cpentry) { diff --git a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml index f8e1a2e7a..9551abe56 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml +++ b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml @@ -97,7 +97,14 @@ </compile> </ajc-test> - + <ajc-test dir="bugs150" pr="79523" title="declare warning : foo(str) : ...;"> + <compile files="pr79523.aj"> + <message line="4" kind="warning" text="no match for this type name: str"/> + <message line="4" kind="error" text="bad parameter"/> + <message line="4" kind="error" text="args() pointcut designator cannot be used in declare statement"/> + </compile> + </ajc-test> + <ajc-test dir="bugs150" pr="107059" title="parser crashes on call(void (@a *)(..)"> <compile files="pr107059.aj"> <message line="3" kind="error" text="Syntax error on token "(", "name pattern" expected"/> diff --git a/weaver/src/org/aspectj/weaver/patterns/ReferencePointcut.java b/weaver/src/org/aspectj/weaver/patterns/ReferencePointcut.java index ec6c36289..6c0ff20c5 100644 --- a/weaver/src/org/aspectj/weaver/patterns/ReferencePointcut.java +++ b/weaver/src/org/aspectj/weaver/patterns/ReferencePointcut.java @@ -298,6 +298,7 @@ public class ReferencePointcut extends Pointcut { IntMap newBindings = new IntMap(); for (int i=0,len=arguments.size(); i < len; i++) { TypePattern p = arguments.get(i); + if (p == TypePattern.NO) continue; //we are allowed to bind to pointcuts which use subtypes as this is type safe if (!p.matchesSubtypes(parameterTypes[i]) && !p.getExactType().equals(UnresolvedType.OBJECT)) |