A class is accessable from another?

陈雨亭 chenyt at cs.sjtu.edu.cn
Sun Jan 3 12:21:36 UTC 2016

Thank you, Ioi.

(1) I rechecked the code. HotSpot complains when I put
java.lang.AbstractStringBuilder to any method (e.g., run()), while
J9 complains only when I put java.lang.AbstractStringBuilder to
the "main" method. Indeed, they take different strategies, although
they should be some compatible to each other.

So, should HotSpot complain if the class AbstractStringBuilder is not
accessable at runtime? I guess AbstractStringBuilder is still usable
(and it also has no effects to the main method) because in JVM 
" Class and Interface Resolution",

To resolve an unresolved symbolic reference from D to a class or interface C 
by N, the following steps are performed:
1. The defining class loader of D is used to create a class or interface 
denoted by
N. This class or interface is C. The details of the process are given in 
Any exception that can be thrown as a result of failure of class or 
creation can thus be thrown as a result of failure of class and interface
2. If C is an array class and its element type is a reference type, ...
3. Finally, access permissions to C are checked.
• If C is not accessible (§5.4.4) to D, class or interface resolution 
throws an
If steps 1 and 2 succeed but step 3 fails, C is still valid and usable.

(2) Thank you for your answer. GraphicsPrimitive$TraceReporter
has been changed to "implement Runnable".


More information about the hotspot-runtime-dev mailing list