Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8290563

Fix incorrect and inconsistent incubator-module warnings

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • None
    • None
    • tools
    • None
    • 9


        $ echo 'public class Foo { public static void main(String ... args) { } }' >Foo.java
        $ java --add-modules jdk.incubator.vector Foo.java
        WARNING: Using incubator modules: jdk.incubator.vector
        warning: using incubating module(s): jdk.incubator.vector
        1 warning
        $ java --add-modules jdk.incubator.vector,jdk.incubator.concurrent Foo.java
        WARNING: Using incubator modules: jdk.incubator.vector, jdk.incubator.concurrent
        warning: using incubating module(s): jdk.incubator.concurrent,jdk.incubator.vector
        1 warning
        $ java --version
        openjdk 19-ea 2022-09-20
        OpenJDK Runtime Environment (build 19-ea+31-2203)
        OpenJDK 64-Bit Server VM (build 19-ea+31-2203, mixed mode, sharing)
        $

      (1) JEP 11 defines incubator modules, not incubating modules.

      (2) Warning that incubator modules are in use when only one incubator module is in use is incorrect.

      (“WARNING” vs. “warning” is due to the fact that the former is emitted by the runtime while the latter is emitted by the compiler. Ideally we’d coalesce the two messages into one when launching a single-file source-code program; see JDK-8290561.)

            mr Mark Reinhold
            mr Mark Reinhold
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: