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

javac grants implied readability to explicit modules

XMLWordPrintable

    • b126
    • Verified

      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.

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

              Created:
              Updated:
              Resolved: