RFR [9] 8152190: Move sun.misc.JarIndex and InvalidJarIndexException to an internal package

Alan Bateman Alan.Bateman at oracle.com
Mon Mar 21 08:33:42 UTC 2016


On 21/03/2016 05:53, Chris Hegarty wrote:
> sun.misc.JarIndex, and its accompanying InvalidJarIndexException, are not
> "Critical APIs", as defined by JEP 260, so they should be moved out of
> sun.misc and placed into a more appropriate package where they can
> be encapsulated.
>
> http://cr.openjdk.java.net/~chegar/8152190/00/
> https://bugs.openjdk.java.net/browse/JDK-8152190
>
> Since the Exception type is only ever statically referenced where it is
> thrown, I’ve moved it to a static nested class of JarIndex, so as to
> keep the namespace cleaner.
>
It probably should be located with URLClassPath but we should try to 
avoid exporting jdk.internal.loader to other modules. I suspect the 
module-info.java in your webrev is based on a merge and exporting this 
package to java.rmi seems dubious. Can we create a bug to get this 
removed? It looks like RegistryImpl is using it out of convenience 
rather than necessity.

There's something fishy with InvalidJarIndexException. The JAR spec 
mentions it but it's a JDK-specific exception. If it's thrown by the 
APIs in java.util.jar then it should be specified in those APIs and the 
exception needs to be java.util.jar.

-Alan.



More information about the core-libs-dev mailing list