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

Latent bug in jar file handling during module path processing.

    Details

    • Subcomponent:
    • Resolved In Build:
      b156
    • CPU:
      generic
    • OS:
      generic
    • Verification:
      Verified

      Backports

        Description

        com.sun.tools.javac.file.Locations.ModulePathLocationHandler.ModulePathIterator#inferModuleName reads:

        // --
        if (p.getFileName().toString().endsWith(".jar") && fsInfo.exists(p)) {
            URI uri = URI.create("jar:" + p.toUri());
        // --

        This code was introduced recently and was modelled after this snippet just
        a few lines below:

        // --
                   if (p.getFileName().toString().endsWith(".jmod")) {
                            try {
                                FileSystem fs = fileSystems.get(p);
                                if (fs == null) {
                                    URI uri = URI.create("jar:" + p.toUri());
        // --

        Both of these are problematic as they construct a URI that will fail
        with a MalformedURLException should a URL ever be constructed
        from the URI.

        At the moment this bug is latent (harmless) since these faulty states are
        transient and quickly disposed without triggering any problems/symptoms.

        But these should be cleaned up.

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  jjg Jonathan Gibbons
                  Reporter:
                  sadayapalam Srikanth Adayapalam
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  5 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: