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

jrtfs implementation for exploded builds is not thread safe

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • 25
    • 24
    • tools

      This bug relates to the observation that the ExplodedImage subclasses of SystemImage:

      src/java.base/share/classes/jdk/internal/jrtfs/ExplodedImage.java

      Has a visible method `getChildren()` on its implementation of `ImageReader.Node`, which calculates the child nodes on demand.

      This method has no syncrhonization and ends up returning the modifiable list (without copying) to the caller, allowing multiple threads to potentially make concurrent modifications to the list (both unwanted and non-thread safe).

      While this is an internal only API, it seems like it would be better if the caching was syncrhonized and the returned list were unmodifiable/immutable.

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

              Created:
              Updated: