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

Cannot compile certain sources with --release

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 18
    • 17, 18
    • tools
    • None
    • b28

        Some sources cannot be compiles with --release 16, as some public, exported, classes extend internal classes that are not available iin the ct.sym. Examples include:
        ---
        import jdk.jfr.Event;

        public class EventTest {
            private void t(Event evt) {
                evt.isEnabled();
            }
        }
        ---
        $ javac --release 16 /tmp/EventTest.java
        /tmp/EventTest.java:5: error: cannot access Event
                evt.isEnabled();
                   ^
          class file for jdk.internal.event.Event not found
        1 error
        ---
        public class VectorTest {
             {
                 jdk.incubator.vector.Vector v = null;
                 v.toString();
             }
        }
        ---
        $ javac --release 16 --add-modules jdk.incubator.vector /tmp/VectorTest.java
        warning: using incubating module(s): jdk.incubator.vector
        /tmp/VectorTest.java:4: error: cannot access VectorSupport
                 v.toString();
                  ^
          class file for jdk.internal.vm.vector.VectorSupport not found
        1 error
        1 warning
        ---

              jlahoda Jan Lahoda
              jlahoda Jan Lahoda
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: