]> source.dussan.org Git - aspectj.git/commitdiff
test for 137479
authoraclement <aclement>
Wed, 19 Apr 2006 11:45:46 +0000 (11:45 +0000)
committeraclement <aclement>
Wed, 19 Apr 2006 11:45:46 +0000 (11:45 +0000)
tests/bugs152/binaryDecp/SubClassLoader.java [new file with mode: 0644]
tests/bugs152/binaryDecp/SubSubClassLoader.java [new file with mode: 0644]
tests/bugs152/binaryDecp/X.aj [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc152/Ajc152Tests.java
tests/src/org/aspectj/systemtest/ajc152/ajc152.xml

diff --git a/tests/bugs152/binaryDecp/SubClassLoader.java b/tests/bugs152/binaryDecp/SubClassLoader.java
new file mode 100644 (file)
index 0000000..f5ba9a4
--- /dev/null
@@ -0,0 +1,27 @@
+// Bug reported that we incorrectly consider static methods when looking at
+// binary weaving decp rules - we shouldn't consider them overriding
+
+import java.util.*;
+
+public class SubClassLoader  {
+  private static List l;
+
+  class Inner {
+   public void foo() {
+     System.err.println(l.toString());
+   }
+  }
+
+
+/*
+  // this one would override java.lang.ClassLoader.access$000 on an IBM VM
+  public static List access$000(ClassLoader cl,String s,byte[] bs,int i,int j,Object o) {
+    return null;
+  }
+
+  // this one would override java.lang.ClassLoader.access$000 on an SUN VM:w
+  public static List access$000() {
+    return null;
+  }
+*/
+}
diff --git a/tests/bugs152/binaryDecp/SubSubClassLoader.java b/tests/bugs152/binaryDecp/SubSubClassLoader.java
new file mode 100644 (file)
index 0000000..4b6b7f6
--- /dev/null
@@ -0,0 +1,12 @@
+import java.util.*;
+
+public class SubSubClassLoader {
+  private static String l;
+
+  class Inner2 {
+   public void foo() {
+     System.err.println(l.toString());
+   }
+  }
+
+}
diff --git a/tests/bugs152/binaryDecp/X.aj b/tests/bugs152/binaryDecp/X.aj
new file mode 100644 (file)
index 0000000..837c825
--- /dev/null
@@ -0,0 +1,4 @@
+public aspect X {
+  declare parents: SubSubClassLoader extends SubClassLoader;
+//  declare parents: SubClassLoader extends ClassLoader;
+}
index 06c11766c3d7bacc42ace00f4aad80c39bb043fb..bff94e8cd31d9f96f098ad30a38330de1cddd348 100644 (file)
@@ -19,6 +19,8 @@ public class Ajc152Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
        
   public void testAspectLibrariesAndASM_pr135001() { runTest("aspect libraries and asm");}
   public void testStackOverflow_pr136258() { runTest("stack overflow");}
+  public void testIncorrectOverridesEvaluation13() { runTest("incorrect overrides evaluation - 1.3"); }
+  public void testIncorrectOverridesEvaluation15() { runTest("incorrect overrides evaluation - 1.5"); }
   
   /////////////////////////////////////////
   public static Test suite() {
index f020e6dc619a77ad2c81bc90a39eb85d1602603b..7ee33b7669bb372a1e389ffe72e03e94a8a4530d 100644 (file)
       <run class="StatisticsTypeImpl"/>
     </ajc-test>
     
+    <ajc-test dir="bugs152/binaryDecp" title="incorrect overrides evaluation - 1.3">
+      <compile files="SubClassLoader.java,SubSubClassLoader.java" options="-1.3" outjar="lib.jar"/>
+      <compile files="X.aj" inpath="lib.jar" options="-showWeaveInfo">
+        <message kind="weave" text="Setting superclass of type 'SubSubClassLoader' (SubSubClassLoader.java) to 'SubClassLoader' (X.aj)"/>
+      </compile>
+    </ajc-test>
+    
+    <ajc-test dir="bugs152/binaryDecp" title="incorrect overrides evaluation - 1.5">
+      <compile files="SubClassLoader.java,SubSubClassLoader.java" options="-1.5" outjar="lib.jar"/>
+      <compile files="X.aj" inpath="lib.jar" options="-showWeaveInfo">
+        <message kind="weave" text="Setting superclass of type 'SubSubClassLoader' (SubSubClassLoader.java) to 'SubClassLoader' (X.aj)"/>
+      </compile>
+    </ajc-test>
+    
 </suite>
\ No newline at end of file