RFR: Fix NullPointerException on a parallel run [v3]
Dmitry Bessonov
dbessono at openjdk.org
Thu Sep 1 01:38:18 UTC 2022
On Thu, 1 Sep 2022 01:26:36 GMT, Dmitry Bessonov <dbessono at openjdk.org> wrote:
>> 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]));
If needed, refactoring like `File` constructors call optimizations deserves to be better done with a separate commit.
-------------
PR: https://git.openjdk.org/jtharness/pull/35
More information about the jtharness-dev
mailing list