RFR: 7903132: Replace casts with type test pattern [v3]

Ethan McCue duke at openjdk.java.net
Fri Mar 25 19:59:41 UTC 2022


On Fri, 25 Mar 2022 16:08:20 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:

>> Strictly speaking, the whole method body could be merged into one expression. Its the realm of infinite bikesheds though, and I did not / do not know if there is a set of implicit style choices there.
>
> Well, we're on the topic of style changes already, so let's pull the string. This is new territory, so I think this is where we decide this :)
> 
> Merging the `instanceof` into the expression avoids having the pattern variable be carried over to outside of the `if` block, which I think is better.
> 
> The `this == other` check above that doesn't have the same problem.

I don't have any particularly strong opinions there, so I made that as the change, leaving the `this == other` checks alone

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

PR: https://git.openjdk.java.net/jextract/pull/5


More information about the jextract-dev mailing list