]> source.dussan.org Git - aspectj.git/commitdiff
test for 145950
authoraclement <aclement>
Thu, 8 Jun 2006 08:27:34 +0000 (08:27 +0000)
committeraclement <aclement>
Thu, 8 Jun 2006 08:27:34 +0000 (08:27 +0000)
tests/bugs152/pr145950/Indirect.java [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/pr145950/Indirect.java b/tests/bugs152/pr145950/Indirect.java
new file mode 100644 (file)
index 0000000..68e0f64
--- /dev/null
@@ -0,0 +1,21 @@
+import java.io.Serializable;
+import java.lang.reflect.Field;
+
+public class Indirect implements I {
+  public static void main(String[] args) {
+    try {
+      Indirect b = (Indirect)Indirect.class.newInstance();
+      Field f = Indirect.class.getDeclaredField("serialVersionUID");
+      long l = f.getLong(b);
+      System.err.println("SerialVersionUID is "+l);
+    } catch (Exception e) {
+      System.err.println("Problem: "+e.toString());
+    }
+  }
+}
+
+interface I extends Serializable {}
+
+aspect X {
+       before(): staticinitialization(Indirect) {}
+}
index 89962aa34de96ad7db17062df105e4a471068844..bc572fc48af4053d96d81eb1a12fe5b352dfbd3c 100644 (file)
@@ -29,6 +29,7 @@ public class Ajc152Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
 //  public void testBrokenIfArgsCflowAtAj_pr145018() { runTest("ataj crashing with cflow, if and args");}
 //  public void testItdCallingGenericMethod_pr145391() { runTest("itd calling generic method");}
 //  public void testItdCallingGenericMethod_pr145391_2() { runTest("itd calling generic method - 2");}
+  public void testBrokenAddSerialVersionUID_pr145950() {runTest("fails to discover Serializable");}
   public void testNoUnnecessaryDeclarationOfThrownExcp_pr129282_1() {runTest("no unnecessary declaration of thrown exception warning - 1");}
   public void testNoUnnecessaryDeclarationOfThrownExcp_pr129282_2() {runTest("no unnecessary declaration of thrown exception warning - 2");}
   public void testNoUnnecessaryDeclarationOfThrownExcp_pr129282_3() {runTest("no unnecessary declaration of thrown exception warning - 3");}
index ad6ef906f308196ade994c9749282efec53b9788..94874154729baf6eccb0d4dc4808201daaaf2da9 100644 (file)
      <compile files="Test.java" options="-1.5"/>
     </ajc-test>
     
+       <ajc-test dir="bugs152/pr145950" title="fails to discover Serializable">
+     <compile files="Indirect.java" options="-1.5 -XaddSerialVersionUID"/>
+     <run class="Indirect">
+       <stderr>
+         <line text="SerialVersionUID is "/>
+       </stderr>
+     </run>
+    </ajc-test>
+        
        <ajc-test dir="bugs152/pr145018" title="ataj crashing with cflow, if and args">
      <compile files="Broken.aj" options="-1.5"/>
      <run class="Broken">