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

Detect patched modules and abort run-time image link early

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 24
    • 24
    • tools
    • None
    • b27
    • generic
    • generic

      During review of JDK-8311302 (implementation of JEP 493) it was pointed out that we should handle the case of JDK modules being patched better. After JDK-8311302 there is this code in JRTArchive, specifically in JRTArchiveFile.toEntry() which handles this case:

                                  try {
                                      return Files.size(archive.getPath().resolve(resPath));
                                  } catch (NoSuchFileException file) {
                                      // This indicates that we don't find the class in the
                                      // modules image using the JRT FS provider. Yet, we find
                                      // the class using the system module finder. Therefore,
                                      // we have a patched module. Mention that module patching
                                      // is not supported.
                                      throw new RuntimeImageLinkException(file.getFile(), PATCH_MODULE);
                                  }

      It might make more sense to detect JDK module patches earlier and abort the link for links from the run-time image.

            sgehwolf Severin Gehwolf
            sgehwolf Severin Gehwolf
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: