On Mon, 13 Apr 2026 13:51:53 GMT, Jan Lahoda <[email protected]> wrote:

>> src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TransPatterns.java 
>> line 1195:
>> 
>>> 1193: 
>>> 1194:             // npe logic
>>> 1195:             JCIf ifNPEstatement = make.If(makeBinary(Tag.EQ, 
>>> letBoundCandidateIdent, makeNull()).setType(syms.booleanType),
>> 
>> Why not `attr.makeNullCheck`? Redundant NPE type for Symtab too.
>
> `makeNullCheck` would make sense to me as well (unless there's a need to 
> special handling).

I need to raise an NPE indeed. Is there any other way to achieve the same 
result?


if (<expression> == null) throw new NullPointerException();

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

PR Review Comment: https://git.openjdk.org/jdk/pull/30556#discussion_r3163029657

Reply via email to