From: aclement Date: Thu, 27 Jan 2005 17:26:48 +0000 (+0000) Subject: Fix for Bug 83645: pertypewithin({interface}) illegal field modifier X-Git-Tag: Root_AspectJ5_Development~49 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=4adf568fdfcc82ea7257cf24f88aefa109deba52;p=aspectj.git Fix for Bug 83645: pertypewithin({interface}) illegal field modifier - moving Wes' test to the regression set. --- diff --git a/tests/ajcTestsFailing.xml b/tests/ajcTestsFailing.xml index b86bc31a3..b3b6401b1 100644 --- a/tests/ajcTestsFailing.xml +++ b/tests/ajcTestsFailing.xml @@ -152,10 +152,4 @@ files="Test_AroundVarBug.java,AroundVarBug.java"/> - - - - - diff --git a/tests/bugs150/PR83645.java b/tests/bugs150/PR83645.java index fa64a9cb8..798f907ff 100644 --- a/tests/bugs150/PR83645.java +++ b/tests/bugs150/PR83645.java @@ -7,6 +7,8 @@ interface IP {} public class PR83645 implements IP { public static void main(String[] args) { try { + boolean hasAspect = PT.hasAspect(IP.class); + if (hasAspect) throw new Error("Shouldn't have an instance for an interface"); boolean yes = (PT.aspectOf(IP.class) instanceof PT); throw new Error("expected NoAspectBoundException, got instance?: " + yes); } catch (NoAspectBoundException e) { @@ -14,11 +16,13 @@ public class PR83645 implements IP { } } } + aspect PT pertypewithin(IP+) { static int INDEX; final int index = INDEX++; - public PT() { - } + + public PT() {} + public String toString() { return "me " + index; } diff --git a/tests/src/org/aspectj/systemtest/ajc150/Ajc150TestsNoHarness.java b/tests/src/org/aspectj/systemtest/ajc150/Ajc150TestsNoHarness.java index 3a446127b..b3835b786 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/Ajc150TestsNoHarness.java +++ b/tests/src/org/aspectj/systemtest/ajc150/Ajc150TestsNoHarness.java @@ -78,13 +78,19 @@ public class Ajc150TestsNoHarness extends TestUtils { public void testPerTypeWithinMissesNamedInnerTypes() { CompilationResult cR = ajc(baseDir,new String[]{"PR83563_1.java"}); - assertTrue("Should be no errors:"+cR,!cR.hasErrorMessages()); + assertMessages(cR,new EmptyMessageSpec()); RunResult rR = run("PR83563_1"); } public void testPerTypeWithinMissesAnonymousInnerTypes() { CompilationResult cR = ajc(baseDir,new String[]{"PR83563_2.java"}); - assertTrue("Should be no errors:"+cR,!cR.hasErrorMessages()); + assertMessages(cR,new EmptyMessageSpec()); RunResult rR = run("PR83563_2"); } + + public void testPerTypeWithinIncorrectlyMatchingInterfaces() { + CompilationResult cR = ajc(baseDir,new String[]{"PR83645.java"}); + assertMessages(cR,new EmptyMessageSpec()); + RunResult rR = run("PR83645"); + } } \ No newline at end of file