On Wed, 9 Apr 2025 09:27:38 GMT, Mikhail Yankelevich <myankelev...@openjdk.org> 
wrote:

>> This **builder** is for PassFailJFrame (user instruction window).
>
> @Renjithkannath apologies, I meant the constructor, line 64 😄

> Minor: Don't you think It's a bit unusual to have the test be executed with 
> the builder of the class? Seems a bit odd to me, but if you prefer it, it's 
> fine as is

Maybe… There are other tests that use this code style.

> I understand, but this is a string value which is always set to null. 
> Wouldn't it be easier to read if it was `null` straight in the method call? 
> Something like this: `g2d.drawString((String) null, 20, 40);`
> 
> If you prefer it as is, it's fine too

@myankelev It's not a new test. Explicit `null` requires cast to either 
`String` or `AttributedCharacterIterator`. The name of the variable have a type 
associated with it. In addition to that, it keeps the code consistent where 
null values are tested and where non-null values are tested, and it's clear 
from the parameter name what is tested.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24501#discussion_r2102222223
PR Review Comment: https://git.openjdk.org/jdk/pull/24501#discussion_r2102231520

Reply via email to