cannot access class jdk.internal.ref.Cleaner (in module java.base) because module java.base does not export jdk.internal.ref to unnamed module

Alan Bateman Alan.Bateman at oracle.com
Sun Aug 7 08:24:34 UTC 2016


On 07/08/2016 09:10, Peter Levart wrote:

> Hi, I've been planing to give a suggestion regarding internal Cleaner 
> implementing Runnable interface. If this internal Cleaner in DBB ever 
> gets replaced with public API in the form of 
> java.lang.reflect.Cleanable implementation, then at that time, such 
> workarrounds will break again and would have to be revised once more. 
> So why wouldn't internal Cleaner rather implement 
> java.lang.reflect.Cleanable instead of Runnable from day one of JDK 9 
> release?
>
The hack involves access to a private/undocumented field so it can never 
be guaranteed to work. But to your point, the internal Cleaner could 
implement java.lang.ref.Cleaner.Cleanable. This seems like something for 
core-libs-dev of course.

-Alan


More information about the jigsaw-dev mailing list