On Fri, 9 Dec 2022 18:02:53 GMT, Jorn Vernee <jver...@openjdk.org> wrote:
> Refactor LambdaForm constructors into static factories. > > In the new code, there's only 1 constructor, which simply initializes all > fields. Multiple factory methods are built on top of this, which add various > argument validation/pre-processing and post processing of the constructed > lambda forms. > > In the LambdaFrom class itself, it is easier to see which LF creation goes > through which checks due to names of factory, or if all checks are bypassed > by calling the constructor. > > New factories can easily be added that bypass all the checks in the existing > factories and just call the root constructor if they so wish to (we likely > want to add several for lazy lambda form resolution > https://bugs.openjdk.org/browse/JDK-8288041). > > Additionally: replaced some default values literals with named constants so > it's easy to see that it's just the default value for that arg at the call > site. This pull request has now been integrated. Changeset: 0532045e Author: Jorn Vernee <jver...@openjdk.org> URL: https://git.openjdk.org/jdk/commit/0532045edb709a995a42c07d95cb1cbabe886bed Stats: 97 lines in 8 files changed: 32 ins; 13 del; 52 mod 8298590: Refactor LambdaForm constructors Reviewed-by: redestad ------------- PR: https://git.openjdk.org/jdk/pull/11612