This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libgcj/11779] New: Field reflection incorrectly throws IllegalAccessException
- From: "bryce at mckinlay dot net dot nz" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 3 Aug 2003 06:03:05 -0000
- Subject: [Bug libgcj/11779] New: Field reflection incorrectly throws IllegalAccessException
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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);
}
}