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

Cannot compile certain sources with --release

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 17, 18
    • Fix Version/s: 18
    • Component/s: tools
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b28

      Backports

        Description

        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
        ---

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  Created:
                  Updated:
                  Resolved: