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

javac grants implied readability to explicit modules

    Details

    • Subcomponent:
    • Resolved In Build:
      b126
    • Verification:
      Verified

      Description

      Consider the following

      m1: explicit module
      m2: automatic module
      m3: explicit module

      m1 requires m2

      compile m1 with a reference to m3 and `-addmods m3`. The compilation succeeds. It seems that m2 has granted implied readability to m3 but it should not do this because m3 is an explicit module.

      At runtime then it fails as expected with IllegalAccessError.

      I attach a zip file with a complete test case.

        Attachments

          Activity

            People

            • Assignee:
              jlahoda Jan Lahoda
              Reporter:
              alanb Alan Bateman
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: