RFR: 7903538: NullPointerException: Cannot read the array length because "<local9>" is null [v2]

Jaikiran Pai jpai at openjdk.org
Wed Mar 20 01:59:43 UTC 2024


On Tue, 19 Mar 2024 20:01:03 GMT, Jonathan Gibbons <jjg at openjdk.org> wrote:

> A better solution, down the road, would be to convert the class to use NIO.

I'll file a separate issue for that.

> src/share/classes/com/sun/javatest/regtest/exec/ScratchDirectory.java line 211:
> 
>> 209:         boolean ok = true;
>> 210:         File[] children = dir.listFiles();
>> 211:         if (children == null) { // should always be not null, but File.listFiles() allows for it
> 
> I find the proposed new comment somewhat confusing. How about:
> 
> `// should always be not null, but may be null if an error occurs`

Hello Jon, I've now updated the PR to use this suggested code comment.

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

PR Comment: https://git.openjdk.org/jtreg/pull/186#issuecomment-2008557586
PR Review Comment: https://git.openjdk.org/jtreg/pull/186#discussion_r1531439121


More information about the jtreg-dev mailing list