On Tue, 17 May 2022 20:59:37 GMT, Phil Race <p...@openjdk.org> wrote:

>> This could even use pattern matching:
>> 
>>         if (g instanceof Graphics2D g2d) {
>>             at = g2d.getTransform();
>
> I thought about that but (1) couldn't remember off-hand if it was still 
> preview, (2) I was sure it would impede a backport ...

[JEP 394: Pattern Matching for instanceof](https://openjdk.java.net/jeps/394) 
was delivered in JDK 16, I've seen it used a few times in JDK code.

It would impede backporting to JDK 11.

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

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

Reply via email to