The following simple test fails:
import java.lang.reflect.*;
public class TestField {
final public int g = 3;
public static void main(String[] args) throws Exception {
TestField t = new TestField();
Field f = t.getClass().getField("g");
f.setAccessible(true);
f.set(t, 4);
System.out.println(t.g);
}
}
Output on RI:
3
Output on Harmony/IBM VME:
Exception in thread "main" java.lang.IllegalAccessException
at java.lang.reflect.Field.setImpl(Native Method)
at java.lang.reflect.Field.set(Field.java:430)
at Test.main(Test.java:8)
See the last comment at
http://jira.codehaus.org/browse/XSTR-379
The similar issue exists for DRLVM:
HARMONY-5199