summaryrefslogtreecommitdiffstats
path: root/tests/bugs/FinalFields.java
diff options
context:
space:
mode:
Diffstat (limited to 'tests/bugs/FinalFields.java')
-rw-r--r--tests/bugs/FinalFields.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/bugs/FinalFields.java b/tests/bugs/FinalFields.java
new file mode 100644
index 000000000..9bc19c84c
--- /dev/null
+++ b/tests/bugs/FinalFields.java
@@ -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");
+ }
+}