]> source.dussan.org Git - aspectj.git/commitdiff
Fix for Bug 83645: pertypewithin({interface}) illegal field modifier
authoraclement <aclement>
Thu, 27 Jan 2005 17:26:48 +0000 (17:26 +0000)
committeraclement <aclement>
Thu, 27 Jan 2005 17:26:48 +0000 (17:26 +0000)
- moving Wes' test to the regression set.

tests/ajcTestsFailing.xml
tests/bugs150/PR83645.java
tests/src/org/aspectj/systemtest/ajc150/Ajc150TestsNoHarness.java

index b86bc31a3cdf0da38b3748f11facea20fdbb9259..b3b6401b1e8e462e90bfc623ed5dd4c36e0d2be8 100644 (file)
           files="Test_AroundVarBug.java,AroundVarBug.java"/>
         <run class="Test_AroundVarBug"/>
     </ajc-test>
-    
-    <ajc-test dir="bugs150" pr="83645"
-      title="pertypewithin on interface">
-               <compile files="PR83645.java"/>
-               <run class="PR83645"/>
-    </ajc-test>
 </suite>
index fa64a9cb820f564be3d07940520e2db50e3d8a12..798f907ff49e050e3e22c60de89b94d1487b30ef 100644 (file)
@@ -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;
     }
index 3a446127b353d77b38ddbc1db1581e7374db2833..b3835b7869e981d5047006bdbb1caa080015af62 100644 (file)
@@ -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