Details
-
Type:
Bug
-
Status: Resolved
-
Priority:
P5
-
Resolution: Fixed
-
Affects Version/s: 16, 17, 18
-
Fix Version/s: 18
-
Component/s: client-libs
-
Labels:None
-
Resolved In Build:b27
Description
Update code checks both non-null and instance of a class in java.desktopmodule classes.
The checks and explicit casts could also be replaced with pattern matching for the instanceof operator.
For example the following code:
if (parent != null) {
if (parent instanceof ScreenMenu) {
final ScreenMenu sm = (ScreenMenu)parent;
sm.setChildVisible(fInvoker, b);
}
}
Can be simplified to:
if (parent instanceof ScreenMenu sm) {
sm.setChildVisible(fInvoker, b);
}
The checks and explicit casts could also be replaced with pattern matching for the instanceof operator.
For example the following code:
if (parent != null) {
if (parent instanceof ScreenMenu) {
final ScreenMenu sm = (ScreenMenu)parent;
sm.setChildVisible(fInvoker, b);
}
}
Can be simplified to:
if (parent instanceof ScreenMenu sm) {
sm.setChildVisible(fInvoker, b);
}