[code-reflection] RFR: Support match all pattern [v2]

Paul Sandoz psandoz at openjdk.org
Mon Sep 16 19:48:18 UTC 2024


On Mon, 16 Sep 2024 07:48:04 GMT, Mourad Abbay <mabbay at openjdk.org> wrote:

>> Support match all pattern.
>> This PR is based on [227](https://github.com/openjdk/babylon/pull/227).
>
> Mourad Abbay has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - Simplify test of match all pattern
>  - Update modeling of match all pattern

src/java.base/share/classes/java/lang/reflect/code/op/ExtendedOp.java line 2922:

> 2920:         }
> 2921: 
> 2922:         static JavaType MatchAllType() {

Suggestion:

        static JavaType matchAllType() {

src/java.base/share/classes/java/lang/reflect/code/op/ExtendedOp.java line 3114:

> 3112:             public static MatchAllPatternOp create(ExternalizedOp def) {
> 3113:                 return new MatchAllPatternOp(def);
> 3114:             }

You don't need this method, the op factory can use `ExternalizedOp` constructor, just make it pubic.

I think we may be able to merge the `create` methods and the constructor when we can use flexible constructor bodies ([JEP 482](https://openjdk.org/jeps/482)).

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

PR Review Comment: https://git.openjdk.org/babylon/pull/230#discussion_r1761769704
PR Review Comment: https://git.openjdk.org/babylon/pull/230#discussion_r1761776149


More information about the babylon-dev mailing list