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

Inconsistent validation and handling of --system flag arguments

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 22
    • None
    • tools
    • None
    • b22

      There are two potential related issues with the validation and handling of javac's --system flag

      (1) jrt-fs.jar is resolved at lib/jrt-fs.jar during validation, but at just jrt-fs.jar on the code path below. This looks like an oversight in the fix for JDK-8169816 (Move src.zip and jrt-fs.jar under the lib directory) which only updated one of the two paths:

      https://github.com/openjdk/jdk/blob/9a866344345291942bf3f6fb27c809cc9009fed7/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/Locations.java#L1399

      https://github.com/openjdk/jdk/blob/9a866344345291942bf3f6fb27c809cc9009fed7/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/Locations.java#L1452

      (2) SystemModulesLocationHandler#update validates that `!Files.exists(p.resolve("lib").resolve("jrt-fs.jar")) && !Files.exists(systemJavaHome.resolve("modules"))`. It seems wrong that it's checking the previous value (systemJavaHome) instead of the new value (p)

      https://github.com/openjdk/jdk/blob/9a866344345291942bf3f6fb27c809cc9009fed7/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/Locations.java#L1399-L1400

            cstein Christian Stein
            cushon Liam Miller-Cushon
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: