]> source.dussan.org Git - aspectj.git/commitdiff
fix for 120474 ($Proxy)
authoraclement <aclement>
Tue, 13 Dec 2005 08:24:13 +0000 (08:24 +0000)
committeraclement <aclement>
Tue, 13 Dec 2005 08:24:13 +0000 (08:24 +0000)
tests/bugs150/pr120474/$Proxy4.java [new file with mode: 0644]
tests/bugs150/pr120474/X.aj [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
tests/src/org/aspectj/systemtest/ajc150/ajc150.xml
weaver/src/org/aspectj/weaver/ResolvedType.java

diff --git a/tests/bugs150/pr120474/$Proxy4.java b/tests/bugs150/pr120474/$Proxy4.java
new file mode 100644 (file)
index 0000000..3b617ca
--- /dev/null
@@ -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 (file)
index 0000000..c0dd297
--- /dev/null
@@ -0,0 +1,3 @@
+public aspect X {
+  before(): execution(* foo(..)) && !within(X) { }
+}
index bba83eeebb60da4d6de71c54d26fe2d557f4d6f4..f00f601a9cd660dc9882978575b8cacb7680f190 100644 (file)
@@ -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");}
index 27b59d27f1fc13b414c976a8d2e3fb971cce9797..ed4d8c1550119c4610d7ad991ce6bebfc72f38af 100644 (file)
      <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">
index a77c88ca14b0a2dc0f3fad0bbd86cb02a6ff931e..524e2a25ff9592792ae6507457f20ea4b837ccfe 100644 (file)
@@ -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);