RFR: 8286269: [java.desktop] Use newer instanceof language feature wherever possible

Phil Race prr at openjdk.java.net
Sun May 8 02:36:48 UTC 2022


On Sat, 8 Jan 2022 18:13:45 GMT, SWinxy <duke at openjdk.java.net> wrote:

> The old java.desktop package needs dusting off. It hasn't been kept up to pace with the Java language, but it should. The purpose of this PR is to replace most or all `instanceof` checks with the new `instanceof` with a variable. Some methods that used `instanceof` were also reworked alongside the change (such as `.equals()`) if they were small and they could be clearer.
> There should be no actual change in outcomes from this PR. I have triple checked my work. Some cases are kinda 'wut?'.
> This is also a large change. When pattern matching for switch arrives, many methods can be reworked to take advantage of it (when it comes.. eventually ;w;).

Please do NOT just show up with a changeset. It is a waste of your time and ours.
Send email to the client mailing list to discuss first.
The amount of attention needed to review these changes and test them is out of all proportion to the absolutely zero benefit to users. 
As client lead, I suggest you find changes that actually make the product better, not these where the only possible change anyone can detect is a regression.
Withdraw and close as will not fix.

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

Changes requested by prr (Reviewer).

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



More information about the client-libs-dev mailing list