-
Bug
-
Resolution: Fixed
-
P4
-
5.0
-
b65
-
generic
-
generic
-
Verified
Exception in thread "main" java.lang.IllegalAccessException: Class refl.ClientTest can not access a member of class refl.a.Base with modifiers "public"
at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:65)
at java.lang.reflect.Method.invoke(Method.java:578)
at refl.ClientTest.main(ClientTest.java:9)
========== test/refl/a/Base.java ==========
1 package refl.a;
2
3 class Base {
4 public void f() {
5 System.out.println("Hello, world!");
6 }
7 }
========== test/refl/a/Pub.java ==========
1 package refl.a;
2
3 public class Pub extends Base {}
========== test/refl/ClientTest.java ==========
1 package refl;
2 import refl.a.*;
3 import java.lang.reflect.*;
4
5 public class ClientTest {
6 public static void main(String[] args) throws Exception {
7 Pub p = new Pub();
8 Method m = Pub.class.getMethod("f");
9 m.invoke(p);
10 }
11 }
- relates to
-
JDK-6378384 (reflect) subclass can’t access superclass’s protected fields and methods by reflection
- Closed
-
JDK-6888164 Bridge methods break obtaining of declaring class annotations
- Closed
-
JDK-8142904 The "getDeclaredMethods" function returns a inherited method
- Closed
-
JDK-6924232 (reflect) IllegalAccessException on public final methods defined in package-access class
- Open
-
JDK-8136614 Accessibility bridges are not created for default methods
- Open
-
JDK-4633201 generics: bridge for inherited final method can cause verify error
- Resolved
-
JDK-8009130 JCK lambda test fails with IllegalAccessException
- Closed
-
JDK-6815786 (reflect) Class.getDeclaredMethods() is returning inherited methods
- Closed
-
JDK-6992717 methods inherited from non-public super class are volatile
- Closed
-
JDK-4032740 (Reflection)Accessibilities of members should be ACCESS-LEVEL sensitive.
- Closed