On Wed, 5 Apr 2023 05:53:38 GMT, Jaikiran Pai <j...@openjdk.org> wrote:

> The new test that was planned for testing `JarFile` and `JarInputStream` when 
> dealing with a jar containing a `META-INF/INDEX.LIST`, is that something that 
> you want to be done as a separate PR/task? It's fine with me if you want that 
> to be done separately.

@jaikiran 

I was looking into creating such a test yesterday. For `JarInputStream`, I was 
able to write a tests which expects a certain order of entries. This could made 
broken by disabling the `META-INF/INDEX.LIST` check in 
`JarInputStream.getNextEntry`.

With `JarVerifier`, I'm struggling to create a scenario which excercises the 
`META-INF/INDEX.LIST` check. It seems to me this code is simply unreachable, 
even after moving the `META-INF/INDEX.LIST` file first in the JAR.

If the code is properly unreachable, then maybe we should consider removing it?

In any case, since I feel the current test is somewhat dubious, I checked it 
into another branch here:

https://github.com/eirbjo/jdk/blob/remove-jar-index-test/test/jdk/java/util/jar/JarFile/JarIndexLegacyJars.java

This is perhaps better than having no tests. I'm not feeling sure about this, 
please let me know what you think. Perhaps @AlanBateman also has an opinion on 
this?

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

PR Comment: https://git.openjdk.org/jdk/pull/13158#issuecomment-1497017466

Reply via email to