On Fri, 27 Jun 2025 23:29:15 GMT, Daniel Hu <d...@openjdk.org> wrote:

> These changes should prevent entire binary files from being loaded into 
> memory for build/AbsPathsInImage.java test. I chose a default buffer size of 
> 8KB since BufferedInputStream uses that, but open to alternative solutions. 
> GHA passes and test passes on linux x64.

test/jdk/build/AbsPathsInImage.java line 186:

> 184:         byte[] buffer = new byte[8192];
> 185:         List<String> matches = new ArrayList<>();
> 186:         try(InputStream inputStream = Files.newInputStream(file)) {

NIT: space after `try`?

test/jdk/build/AbsPathsInImage.java line 204:

> 202:         ZipEntry zipEntry;
> 203:         int bytesRead;
> 204:         byte[] buffer = new byte[8192];

NIT: would be cleaner if the `8192` were a constant in the test class itself.

test/jdk/build/AbsPathsInImage.java line 208:

> 206:             while ((zipEntry = zipInputStream.getNextEntry()) != null) {
> 207:                 List<String> matches = new ArrayList<>();
> 208:                 while((bytesRead = zipInputStream.read(buffer)) != -1) {

NIT: space after `while`.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26030#discussion_r2190773742
PR Review Comment: https://git.openjdk.org/jdk/pull/26030#discussion_r2190773440
PR Review Comment: https://git.openjdk.org/jdk/pull/26030#discussion_r2190771622

Reply via email to