RFR: 8259025: Record compact constructor using Objects.requireNonNull

Attila Szegedi attila at openjdk.java.net
Sun Jan 10 20:06:59 UTC 2021


On Sat, 2 Jan 2021 12:32:05 GMT, Guoxiong Li <github.com+13688759+lgxbslgx at openjdk.org> wrote:

> Hi all,
> 
> Currently, the method `Attr::lambdaEnv` doesn't set the `lambdaEnv.info.isLambda` to `true` and lets the caller set it. But not all the callers remember to set it. In this bug, `DefferredAttr::attribSpeculativeLambda` uses `Attr::lambdaEnv` and doesn't set `lambdaEnv.info.isLambda` to `true`. So when `Attr::visitReturn` uses `!env.info.isLambda` to judge if it is in the lambda environment, it gets the wrong information and generates an error message.
> 
> This patch moves `lambdaEnv.info.isLambda = true;` into `Attr::lambdaEnv` to solve the problem and adds a corresponding test case. Thank you for taking the time to review.
> 
> Best Regards.

Looks good, thanks for fixing this!

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

Marked as reviewed by attila (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/1917


More information about the compiler-dev mailing list