]> source.dussan.org Git - aspectj.git/commitdiff
added test for Bugzilla Bug 37304
authorjhugunin <jhugunin>
Mon, 19 May 2003 20:46:49 +0000 (20:46 +0000)
committerjhugunin <jhugunin>
Mon, 19 May 2003 20:46:49 +0000 (20:46 +0000)
   public static fields being ignored
this test is passing in 1.1rc2

tests/ajcTests.xml
tests/bugs/FinalFields.java [new file with mode: 0644]

index c5ebe25756a6dda85105bf75232b3e01a312e49e..7cce70cb91fadb18388a71eac7e2726d5d4254a6 100644 (file)
         </compile>
         <run class="CatchSig"/>
     </ajc-test>
+    
+
+    <ajc-test dir="bugs" pr="37304"
+        title="public static fields being ignored">
+        <compile files="FinalFields.java"/>
+        <run class="FinalFields"/>
+    </ajc-test>
 
 </suite>
diff --git a/tests/bugs/FinalFields.java b/tests/bugs/FinalFields.java
new file mode 100644 (file)
index 0000000..9bc19c8
--- /dev/null
@@ -0,0 +1,18 @@
+
+import java.io.Serializable;
+
+import java.lang.reflect.*;
+
+public class FinalFields implements Serializable {
+   public static final Integer SUCCESS = new Integer(0);
+
+       public static void main(String[] args) throws Exception {
+               Class c = FinalFields.class;
+               Field f = c.getDeclaredField("SUCCESS");
+               int mods = f.getModifiers();
+               System.out.println("modifers are: " + Modifier.toString(mods));
+               if (!Modifier.isFinal(mods)) throw new RuntimeException("modifier should be final");
+               if (!Modifier.isPublic(mods)) throw new RuntimeException("modifier should be public");
+               if (!Modifier.isStatic(mods)) throw new RuntimeException("modifier should be static");
+       }
+}