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

javac does not detect split packages between classpath and system image

    Details

    • Type: Bug
    • Status: Open
    • Priority: P3
    • Resolution: Unresolved
    • Affects Version/s: 9, 10, 11, 12, 13
    • Fix Version/s: tbd
    • Component/s: tools
    • Labels:
      None

      Description

      See the mail thread beginning here:
      http://mail.openjdk.java.net/pipermail/jigsaw-dev/2018-December/014076.html
      and reference on StackOverflow:
      https://stackoverflow.com/q/51094274/4611488

      Extract from initial post:
      -------
      The question can be simplified like this:
      //---
      import javax.xml.transform.Transformer;

      public class Test {
          Transformer transformer;
      }
      //---

      Which of the following compiler invocations should accept / reject the program:

      $ javac Test.java
      $ javac -classpath xml-apis-1.4.01.jar Test.java
      $ javac -classpath xml-apis-1.4.01.jar --limit-modules=java.base,java.xml Test.java
      $ javac -classpath xml-apis-1.4.01.jar --limit-modules=java.base Test.java :
      -------

      Extract of response from [~abuckley]
       
      -------
      I agree that only the first and last invocations should succeed.

      tl;dr A package split between the classpath and the system image is just as bad as a package split between two modules on the modulepath.
      -------

      See attached test.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated: