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

javac: 'opens' statement cannot specify non observable package

XMLWordPrintable

    • b156
    • Verified

        Currently spec specifies:

        It is permitted for opens to specify a package which is not observable in the current module.

        However javac from JDK9 b152 currently produce compiler error in this case. For instance following module declaration fails to be compiled, provided there are no package 'pack' in module A:

        module A {
            opens pack;
        }

        The minimized test case is attached. In order to reproduce, please:
        1. Unzip attached archive to some directory on Unix/Linux machine, say A;
        2. Modify A/Test59/test.sh by setting JDK_HOME to your JDK root dir;
        3. Run A/Test59/test.sh;

        This results in following output:

        ./A/module-info.java:2: error: package is empty or does not exist: pack
            opens pack;
                  ^
        1 error

              jjg Jonathan Gibbons
              grakov Georgiy Rakov (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

                Created:
                Updated:
                Resolved: