Issue Details (XML | Word | Printable)

Key: HARMONY-5200
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: Vasily Zakharov
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Harmony

[ibm vme] final fields cannot be set accessible

Created: 26/Nov/07 09:08 PM   Updated: 26/Nov/07 09:08 PM
Return to search
Component/s: VM
Affects Version/s: None
Fix Version/s: None

Time Tracking:
Not Specified

Issue Links:
Reference
 


 Description  « Hide
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


 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
There are no subversion log entries for this issue yet.