Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java 9: How to find every new method added

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

like image 476
Jacob G. Avatar asked Nov 08 '17 18:11

Jacob G.


2 Answers

There are many changes to existing classes and members, in addition to new @since 9 classes and members. The final release of JSR 379 include an annex with the complete set of diffs. The draft is online here: http://cr.openjdk.java.net/~iris/se/9/java-se-9-fr-spec-01/apidiffs/overview-summary.html

like image 200
Alan Bateman Avatar answered Sep 19 '22 20:09

Alan Bateman


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>
like image 45
Naman Avatar answered Sep 17 '22 20:09

Naman