RFR: 8302819: Remove JAR Index

Mandy Chung mchung at openjdk.org
Tue Mar 28 20:13:33 UTC 2023


On Thu, 23 Mar 2023 12:05:50 GMT, Eirik Bjorsnos <duke at openjdk.org> wrote:

> 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

Happy to see this work!  This change looks fine in general.    I agree that it's good to keep this issue to remove the runtime support and separate the `jar -i` change.   JDK tools don't run with security manager enabled and no need to wrap `System::getProperty` with `doPrivileged`.

src/java.base/share/classes/jdk/internal/loader/URLClassPath.java line 936:

> 934:         @Override
> 935:         URL[] getClassPath() throws IOException {
> 936: 

Nit: extra line 936 can be removed.

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

PR Review: https://git.openjdk.org/jdk/pull/13158#pullrequestreview-1361828286
PR Review Comment: https://git.openjdk.org/jdk/pull/13158#discussion_r1151099546



More information about the security-dev mailing list