summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraclement <aclement>2005-12-13 08:24:13 +0000
committeraclement <aclement>2005-12-13 08:24:13 +0000
commit3339edbae5d6891cfbde6952329a4ff2808a7901 (patch)
tree2564c2a7b598326a064a4577cb8d60d491b91d3b
parentdf3adcd1825893130a1873dfcad1bd82e5b9f70b (diff)
downloadaspectj-3339edbae5d6891cfbde6952329a4ff2808a7901.tar.gz
aspectj-3339edbae5d6891cfbde6952329a4ff2808a7901.zip
fix for 120474 ($Proxy)
-rw-r--r--tests/bugs150/pr120474/$Proxy4.java3
-rw-r--r--tests/bugs150/pr120474/X.aj3
-rw-r--r--tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java2
-rw-r--r--tests/src/org/aspectj/systemtest/ajc150/ajc150.xml4
-rw-r--r--weaver/src/org/aspectj/weaver/ResolvedType.java2
5 files changed, 12 insertions, 2 deletions
diff --git a/tests/bugs150/pr120474/$Proxy4.java b/tests/bugs150/pr120474/$Proxy4.java
new file mode 100644
index 000000000..3b617ca31
--- /dev/null
+++ b/tests/bugs150/pr120474/$Proxy4.java
@@ -0,0 +1,3 @@
+public class $Proxy4 {
+ public void foo() {}
+}
diff --git a/tests/bugs150/pr120474/X.aj b/tests/bugs150/pr120474/X.aj
new file mode 100644
index 000000000..c0dd297e5
--- /dev/null
+++ b/tests/bugs150/pr120474/X.aj
@@ -0,0 +1,3 @@
+public aspect X {
+ before(): execution(* foo(..)) && !within(X) { }
+}
diff --git a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
index bba83eeeb..f00f601a9 100644
--- a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
+++ b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
@@ -41,7 +41,7 @@ public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
protected File getSpecFile() {
return new File("../tests/src/org/aspectj/systemtest/ajc150/ajc150.xml");
}
-
+ public void testDollarClasses_pr120474() { runTest("Dollar classes");}
public void testGenericPTW_pr119539_1() { runTest("generic pertypewithin aspect - 1");}
public void testGenericPTW_pr119539_2() { runTest("generic pertypewithin aspect - 2");}
public void testGenericPTW_pr119539_3() { runTest("generic pertypewithin aspect - 3");}
diff --git a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml
index 27b59d27f..ed4d8c155 100644
--- a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml
+++ b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml
@@ -174,6 +174,10 @@
<compile files="Test.java,TestAspect.java,Audit.java,AuditImpl.java" options="-1.5"/>
<run class="Test"/>
</ajc-test>
+
+ <ajc-test dir="bugs150/pr120474" pr="120474" title="Dollar classes">
+ <compile files="$Proxy4.java,X.aj"/>
+ </ajc-test>
<ajc-test dir="bugs150/pr111667" pr="111667" title="lint for advice sorting">
<compile files="A.java,X.java,Y.java" options="-1.5 -Xlint:warning">
diff --git a/weaver/src/org/aspectj/weaver/ResolvedType.java b/weaver/src/org/aspectj/weaver/ResolvedType.java
index a77c88ca1..524e2a25f 100644
--- a/weaver/src/org/aspectj/weaver/ResolvedType.java
+++ b/weaver/src/org/aspectj/weaver/ResolvedType.java
@@ -1251,7 +1251,7 @@ public abstract class ResolvedType extends UnresolvedType implements AnnotatedEl
if (isArray()) return null;
String name = getName();
int lastDollar = name.lastIndexOf('$');
- while (lastDollar != -1) {
+ while (lastDollar >0) { // allow for classes starting '$' (pr120474)
ResolvedType ret = world.resolve(UnresolvedType.forName(name.substring(0, lastDollar)), true);
if (!ResolvedType.isMissing(ret)) return ret;
lastDollar = name.lastIndexOf('$', lastDollar-1);