On Tue, 7 Apr 2026 14:55:34 GMT, Eirik Bjørsnøs <[email protected]> wrote:
>> Jaikiran Pai has updated the pull request incrementally with one additional
>> commit since the last revision:
>>
>> rename test method
>
> test/jdk/java/util/jar/JarEntry/GetMethodsReturnClones.java line 149:
>
>> 147: try (JarOutputStream out = new
>> JarOutputStream(Files.newOutputStream(unsigned))) {
>> 148: out.putNextEntry(new JarEntry(ENTRY_NAME));
>> 149: out.write(new byte[]{(byte) 0XCA, (byte) 0XFE, (byte) 0XBA,
>> (byte) 0XBE});
>
> Although this is a nice tip of the hat to the Java class file format and its
> magic bytes header, I think a more "boring"
> "hello".getBytes(StandardCharsets.UTF_8) would also work fine here and reduce
> parsing on future maintainers trying to understand if the content is
> significant or not.
Fixed
> test/jdk/java/util/jar/JarEntry/GetMethodsReturnClones.java line 170:
>
>> 168: private static KeyStore.PrivateKeyEntry privateKeyEntry() throws
>> Exception {
>> 169: final CertAndKeyGen gen = new CertAndKeyGen(KEY_TYPE,
>> SIGNATURE_ALGORITHM);
>> 170: gen.generate(4096);
>
> I'm curious if the algorithm / key size choices here and in similar signed
> jar tests have meaningful impact on test duration?
>
> EC keys are smaller and should be faster? I could test this myself, just
> wondering if the choices here were deliberate.
The entire test action completes within a couple of seconds:
command: junit GetMethodsReturnClones
reason: User specified action: run junit GetMethodsReturnClones
...
elapsed time (seconds): 1.166
so the key size wasn't a factor here.
> test/jdk/java/util/jar/JarEntry/GetMethodsReturnClones.java line 176:
>
>> 174: }
>> 175:
>> 176: private static boolean isSignatureFileEntry(final JarEntry entry) {
>
> I think there's precedence in the JDK to call this predicate
> "isSignatureRelated", see `ZipFile.Source.isSignatureRelated`. Using that
> name may help recognition.
Done, renamed the method.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/30602#discussion_r3050701257
PR Review Comment: https://git.openjdk.org/jdk/pull/30602#discussion_r3050699530
PR Review Comment: https://git.openjdk.org/jdk/pull/30602#discussion_r3050700501