RFR: 8259025: Record compact constructor using Objects.requireNonNull
Guoxiong Li
github.com+13688759+lgxbslgx at openjdk.java.net
Sat Jan 2 12:39:01 UTC 2021
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.
-------------
Commit messages:
- 8259025: Record compact constructor using Objects.requireNonNull
Changes: https://git.openjdk.java.net/jdk/pull/1917/files
Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=1917&range=00
Issue: https://bugs.openjdk.java.net/browse/JDK-8259025
Stats: 15 lines in 2 files changed: 11 ins; 1 del; 3 mod
Patch: https://git.openjdk.java.net/jdk/pull/1917.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/1917/head:pull/1917
PR: https://git.openjdk.java.net/jdk/pull/1917
More information about the compiler-dev
mailing list