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.
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.
- relates to
-
JDK-8355953 Add unit testing for internal jrtfs class prior to Valhalla work
-
- Open
-
- links to
-
Review(master) openjdk/jdk/26757