Re: RFR: 8274640: Cleanup unnecessary null comparison before instanceof check in java.desktop

2021-11-27 Thread Alexey Ivanov
On Sat, 11 Sep 2021 14:59:21 GMT, Andrey Turbanov wrote: > Updated code checks both non-null and instance of a class in java.desktop > module classes. > The checks and explicit casts could also be replaced with pattern matching > for the instanceof operator. > Similar cleanups > 1. [JDK-827348

Re: RFR: 8277868: Use Comparable.compare() instead of surrogate code

2021-11-27 Thread Michael Bien
On Fri, 26 Nov 2021 12:46:59 GMT, Сергей Цыпанов wrote: > Instead of something like > > long x; > long y; > return (x < y) ? -1 : ((x == y) ? 0 : 1); > > we can use `return Long.compare(x, y);` > > All replacements are done with IDE. src/java.desktop/share/classes/javax/swing/plaf/basic/Basic