From 3339edbae5d6891cfbde6952329a4ff2808a7901 Mon Sep 17 00:00:00 2001 From: aclement Date: Tue, 13 Dec 2005 08:24:13 +0000 Subject: [PATCH] fix for 120474 ($Proxy) --- tests/bugs150/pr120474/$Proxy4.java | 3 +++ tests/bugs150/pr120474/X.aj | 3 +++ tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java | 2 +- tests/src/org/aspectj/systemtest/ajc150/ajc150.xml | 4 ++++ weaver/src/org/aspectj/weaver/ResolvedType.java | 2 +- 5 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 tests/bugs150/pr120474/$Proxy4.java create mode 100644 tests/bugs150/pr120474/X.aj 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 @@ + + + + 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); -- 2.39.5