RFR [9] 8152190: Move sun.misc.JarIndex and InvalidJarIndexException to an internal package
Chris Hegarty
chris.hegarty at oracle.com
Mon Mar 21 17:42:19 UTC 2016
On 21 Mar 2016, at 08:33, Alan Bateman <Alan.Bateman at oracle.com> wrote:
> 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.
Agreed.
> 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.
Correct. I filed 8152277 [1] to track this, and will have it out for review soon.
> 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.
You may be right. I filed 8152276 [2] to track this issue.
Once 8152277 is fixed, I’ll rethink the solution to this issue.
-Chris.
[1] https://bugs.openjdk.java.net/browse/JDK-8152277
[2] https://bugs.openjdk.java.net/browse/JDK-8152276
More information about the core-libs-dev
mailing list