Java 9: How to find every new method added

Viewed 419

With the release of Java 9, numerous methods have been added to many classes, most (if not all) of which contain the following in their documentation:

Since: 9

Is there an easy way to find any new methods added in an arbitrary class without having to scour through its documentation?

Example: ByteBuffer.alignedSlice

2 Answers

You're probably looking for something like jdkapidiff which uses japicmp to generate reports similar to one hosted here by the author - jdk8-jdk9-api-diff.

You can clone the project and execute mvn clean install to get the similar report on your local.

Provide a file ~.m2/toolchains.xml like this:

<?xml version="1.0" encoding="UTF8"?>
<toolchains>
    <toolchain>
        <type>jdk</type>
        <provides>
            <version>1.8</version>
            <vendor>oracle</vendor>
        </provides>
        <configuration>
            <jdkHome>/path/to/jdk-1.8</jdkHome>
        </configuration>
    </toolchain>
    <toolchain>
        <type>jdk</type>
        <provides>
            <version>9</version>
            <vendor>oracle</vendor>
        </provides>
        <configuration>
            <jdkHome>/path/to/jdk-9</jdkHome>
        </configuration>
    </toolchain>
</toolchains>
Related