List of removed/internalized classes for Java 9

Alan Bateman Alan.Bateman at oracle.com
Tue Oct 18 16:03:55 UTC 2016


On 18/10/2016 15:52, Andrew Guibert wrote:

> :
>
> So my question is:
> Is there a list of removed/internalized classes for java 9 anywhere?  I
> would like to use this list to grep my codebase for soft references.
>
>
I don't think there is a list anywhere. Also it would be a moving target 
because there are classes added/removed/renamed in sun.** and jdk.** 
every week.

One thing that might help is to get a list of the JDK-internal packages 
in your current build. Here's one way to create this:

         ModuleFinder.ofSystem()
             .findAll()
             .stream()
             .map(ModuleReference::descriptor)
             .map(md -> {
                 Set<String> packages = new HashSet<>(md.packages());
                 md.exports()
                     .stream()
                     .filter(e -> !e.isQualified())
                     .map(Exports::source).forEach(pn -> 
packages.remove(pn));
                 return packages;
             })
             .flatMap(Set::stream)
             .sorted()
             .forEach(System.out::println);

Alternatively you can specify all modules to `java --list-modules` and 
filter out the unqualified exports.

-Alan.


More information about the jigsaw-dev mailing list