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

Fix multiple issues in ExplodedImage

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • 26
    • None
    • tools
    • None

      While adding unit tests for ExplodedImage (originally JDK-8355953), the following issues were found:

      1. ExplodedImage is fundamentally untestable in it current form.
        - Necessary to fix for adding unit tests.

      2. Package "link" nodes behave incorrectly
        - Current version incorrectly resolves trailing paths. This is deliberately coded, but incorrect behavior.

      3. Missing override method results in broken "type" reporting.
        - A resource node currently returns "false" for *all* of the isXxxx() methods because "isResource()" is not overridden.

      4. Needless use of ConcurrentHashMap.
        - Apart from close(), every map access is already synchronised, so HashMap would suffice and be faster.

      5. Incorrect logic around module paths.
        - A mistake in logic allows the path "/modules/" to resolve to a node. This is an edge case only caught with targeted unit tests.

      6. Nodes can be created for non-file filesystem objects.
        - Nodes should only exist for plain files or directories. Currently a resource node could be created for device files or symbolic links.

      Issues 1-3 are important, but 4-6 seem worth fixing while work is being done on the class.

            dabeaumo David Beaumont
            dabeaumo David Beaumont
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: