This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libgcj/11779] New: Field reflection incorrectly throws IllegalAccessException


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11779

           Summary: Field reflection incorrectly throws
                    IllegalAccessException
           Product: gcc
           Version: 3.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libgcj
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bryce at mckinlay dot net dot nz
                CC: gcc-bugs at gcc dot gnu dot org

There appears to be a problem with security checks recently added to reflection code. The 
following test case incorrectly throws IllegalAccessException.

import java.lang.reflect.*;

public class RefTest
{
  int value;

  public static void main(String[] args) 
    throws NoSuchFieldException, IllegalAccessException
  {
    RefTest testObj = new RefTest();
    Field field = RefTest.class.getDeclaredField("value");
    field.setInt(testObj, 777);
  }
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]