Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8284161 Implementation of Virtual Threads (Preview)
  3. JDK-8288416

Release Note: Source and Binary Incompatible Changes to java.lang.Thread

XMLWordPrintable

      The are a few source and binary incompatible changes that may impact code that extends `java.lang.Thread`.

      - `Thread` defines several new methods in this release. If code in an existing source file extends `Thread` and a method in the subclass conflicts with any of the new `Thread` methods then the file will not compile without change.

      - `Thread.Builder` is added as a nested interface. If code in an existing source file extends `Thread`, imports a class named `Builder`, and code in the subclass references "Builder" as a simple name, then the file will not compile without change.

      - `Thread.isVirtual()`, `Thread.threadId()` and `Thread.join(Duration)` are added as final methods. If there is existing compiled code that extends `Thread` and the subclass declares a method with the same name, parameters, and return type as any of these methods then `IncompatibleClassChangeError` will be thrown at run-time if the subclass is loaded.

      For further details, see the [JEP 425, section java.lang.Thread](https://openjdk.java.net/jeps/425#java-lang-Thread).

            alanb Alan Bateman
            alanb Alan Bateman
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: