RFR: 7903336: java.lang.NullPointerException: at com.sun.javatest.TestSuite$GeneralPurposeLogger.<init>(TestSuite.java:1494) [v2]

Dmitry Bessonov dbessono at openjdk.org
Sun Oct 2 13:14:34 UTC 2022


On Fri, 30 Sep 2022 02:17:25 GMT, Leonid Kuskov <lkuskov at openjdk.org> wrote:

> From my point of view the corner case isn't "non thread safe" HashMap but it is potential null of `new WorkDirLogHandler(ts.getObservedFile(wd)` . This code can use only 2 HashMap commands:
> 
>     1. ` if (!handlersMap.containsKey(logFileName) {` and
> 
>     2. ` handlersMap.put(logFileName, wdlh);` if wdlh isn't `null`
> 
>     3. and the last command of the block is `addHandler(wdlh);`

Big thanks for in-depth review and the comments! Updated the change as per conversation.

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

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


More information about the jtharness-dev mailing list