RFR: 8349151: Refactor test/java/security/cert/CertificateFactory/slowstream.sh to java test [v2]
Rajan Halade
rhalade at openjdk.org
Thu May 8 05:33:01 UTC 2025
On Mon, 3 Feb 2025 19:12:30 GMT, Mikhail Yankelevich <myankelevich at openjdk.org> wrote:
>> Refactor test/java/security/cert/CertificateFactory/slowstream.sh to java test
>
> Mikhail Yankelevich has updated the pull request incrementally with one additional commit since the last revision:
>
> cleanup
Changes requested by rhalade (Reviewer).
test/jdk/java/security/cert/CertificateFactory/SlowStream.java line 32:
> 30:
> 31: import java.io.*;
> 32: import java.security.cert.*;
Suggestion:
import java.io.File;
import java.io.FileInputStream;
import java.io.PipedInputStream;
import java.io.PipedOutputStream;
import java.security.cert.CertificateFactory;
test/jdk/java/security/cert/CertificateFactory/SlowStream.java line 55:
> 53: outputStream.write(buffer, 0, len);
> 54: }
> 55: Thread.sleep(2000);
Suggestion:
try(final var fin = new FileInputStream(new File(new File(
System.getProperty("test.src", "."), "openssl"), "pem"))) {
final byte[] buffer = new byte[4096];
while (true) {
int len = fin.read(buffer);
if (len < 0) {
break;
}
outputStream.write(buffer, 0, len);
}
Thread.sleep(2000);
}
test/jdk/java/security/cert/CertificateFactory/SlowStream.java line 94:
> 92: }
> 93: }
> 94: }
Suggestion:
}
-------------
PR Review: https://git.openjdk.org/jdk/pull/23394#pullrequestreview-2823835159
PR Review Comment: https://git.openjdk.org/jdk/pull/23394#discussion_r2078904169
PR Review Comment: https://git.openjdk.org/jdk/pull/23394#discussion_r2078910272
PR Review Comment: https://git.openjdk.org/jdk/pull/23394#discussion_r2078908630
More information about the security-dev
mailing list