RFR: Fix NullPointerException on a parallel run [v3]

Dmitry Bessonov dbessono at openjdk.org
Thu Sep 1 01:30:22 UTC 2022


On Thu, 1 Sep 2022 01:13:42 GMT, Jonathan Gibbons <jjg at openjdk.org> wrote:

>> Also, it might be better not to pull in an additional constructor that was not used before, but rather maximally stick with the existing code and APi calls it does
>
> If `null` is a possibility, check for it.
> 
> ?? I don't understand the concern about referencing a different constructor that has been around since the beginning of Java time, and why it is better to do string arithmetic to construct a file path.

Implicitly checking for `null` here below. 
If we could keep the existing approaches and API calls in the legacy code base, let's not pull anything new without necessity. I guess we don't have necessity to call an API that is new to this context.


processFile("".equals(path) // Zero length string if the node is a root
    ? new File(filesToScan[i]) 
    : new File(path + File.separator + filesToScan[i]));

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

PR: https://git.openjdk.org/jtharness/pull/35


More information about the jtharness-dev mailing list