-
Bug
-
Resolution: Duplicate
-
P4
-
1.1.1, 1.1.3, 1.1.6, 1.1.8, 1.2.0, 1.3.0, 1.3.1, 1.4.0, 1.4.1, 6u27, 7, 8, 9
-
generic, x86, sparc
-
generic, linux, solaris_2.5.1, windows_nt, windows_2000, windows_xp
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2214429 | 7u2 | Unassigned | P4 | Closed | Won't Fix |
Running the following program, which should succeed, results in an
IllegalAccessException.
import java.lang.reflect.*;
public class TestPrivateAccess extends Object
{
TPAInnerClass inner = new TPAInnerClass();
private void privateMethod()
{System.out.println("private method.");}
class TPAInnerClass extends Object
{
void dynamicInvoke()
{
try
{
Method method =
TestPrivateAccess.class.getDeclaredMethod("privateMethod", new Class[] {});
method.invoke(TestPrivateAccess.this, new Object[] {});
}
catch (Exception e)
{e.printStackTrace();}
}
}
public static void main(String[] argv)
{
TestPrivateAccess tpa = new TestPrivateAccess();
tpa.inner.dynamicInvoke();
}
}
company - MIT Media Lab , email - ###@###.###
======================================================================
- backported by
-
JDK-2214429 (reflect) Method.invoke access control does not understand inner class scoping
- Closed
- duplicates
-
JDK-4819108 (reflect) Method.invoke throws IllegalAccessException on inner class public meth
- Closed
-
JDK-4071593 (reflect) Method.invoke() throws spurious IllegalAccessException
- Closed
-
JDK-4207233 (reflect) can't use reflection to invoke private method in outer class
- Closed
-
JDK-4209315 (reflect) error in invoking inner class method thru reflection
- Closed
-
JDK-4533479 (reflect) invoke() may fail even for public method on IllegalAccessException
- Closed
-
JDK-4710855 IllegalAccessException calling public method of object whose class is anonymous.
- Closed
-
JDK-4238091 (reflect) Class.getFields returns fields which are not public
- Closed
-
JDK-8046171 JEP 181: Nest-Based Access Control
- Closed
- relates to
-
JDK-4283544 (reflect) Field and Method do not correctly obey language accessibility rules
- Open
-
JDK-4852768 Exception when accessing Enumerator object from VBScript (ASP)
- Resolved
-
JDK-8046171 JEP 181: Nest-Based Access Control
- Closed
-
JDK-4032740 (Reflection)Accessibilities of members should be ACCESS-LEVEL sensitive.
- Closed