RFR: 8302819: Remove JAR Index

Eirik Bjorsnos duke at openjdk.org
Tue Mar 28 17:57:38 UTC 2023


This PR removes the JAR index feature from the runtime:

- `URLClassPath` is  updated to remove the `enableJarIndex` system property and any code which would be called when this property was `true`
- The `JarIndex` implementation class is moved into `jdk.jartool` module.
- The `InvalidJarIndexError` exception class is removed because it falls out of use
- The test `test/jdk/sun/misc/JarIndex/metaInfFileNames/Basic.java` is removed because it depends on the JarIndex feature being present
- The test `test/jdk/sun/misc/JarIndex/JarIndexMergeForClassLoaderTest.java` is removed because it depends on the JarIndex feature being present
- The test `test/jdk/sun/misc/JarIndex/JarIndexMergeTest.java` is removed because it end up being the only caller of the  JarIndex.merge feature
- All `JarIndex` methods/constructors which are not used by the `jar -i` implementation are removed. 
- `JarIndex` is given package-private access.

Outstanding code work:

- Create tests for `JarFile` and `JarInputStream` accepting dusty INDEX jars.

Outstanding work:

- CSR for the removal
- Release notes for the removal
- Coordination of the update of the Jar File Specification

-------------

Commit messages:
 - Remove JarIndex default constructor
 - Make JarIndex.INDEX_NAME package private
 - Remove outdated reference to URLClassLoader using JarIndex
 - Make JarIndex package private
 - The JarIndex.merge method ended up being used only by the JarIndexMergeTest test. Removing this test, the JarIndex.merge methods and a number of other JarIndex methods not used by the 'jar' tool
 - Revert the export of sun.security.action to jdk.jartool. JarIndex can use System.property instead since the 'jar' tool does not run with a SecurityManager
 - Revert noisy whitespace changes
 - Revert noisy whitespace changes
 - Remove jar index feature from the runtime. Move JarIndex into jdk.jartool. Remove tests which depend on the jar index feature being considered during class loading.

Changes: https://git.openjdk.org/jdk/pull/13158/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=13158&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8302819
  Stats: 1809 lines in 24 files changed: 221 ins; 1576 del; 12 mod
  Patch: https://git.openjdk.org/jdk/pull/13158.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/13158/head:pull/13158

PR: https://git.openjdk.org/jdk/pull/13158



More information about the security-dev mailing list