Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-6612

DevelopmentModeClasspathFile should use the same resource for last modified and output stream

    XMLWordPrintable

Details

    Description

      The getLastModified() method of DevelopmentModeClasspathFile uses this code to determine a resource URL:

      final URL resourceUrl = ClasspathHelper.contextClassLoader().getResource(jarFile.getRelativePath());
      

      However, the openStream() method returns jarFile.openInputStream() directly, which in our case (we use our own class loader in development) means that DevelopmentModeClasspathFile doesn't use the same resource for the output stream and the last modified date!

      We now use a patched version of DevelopmentModeClasspathFile in which openStream() determines the resourceURL exactly as in getLastModified() and then returns resourceURL.getInputStream(). We hope you'll incorporate this change into your code base, so we can drop our patched class with a future release.

      Checklists

        Acceptance criteria

        Attachments

          Issue Links

            Activity

              People

                Unassigned Unassigned
                breun Nils Breunese
                Mathijn Elhorst, Michiel Meeuwissen, Rico Jansen
                DeveloperX
                Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                  Created:
                  Updated:

                  Checklists

                    Bug DoR
                    Task DoD