@@ -116,8 +116,7 @@ public static CSSStylableElement getCSSElement(Object o) {
116116 /** @return the CSS engine governing the argument, or null if none */
117117 public static CSSEngine getCSSEngine (Object o ) {
118118 CSSEngine engine = null ;
119- if (o instanceof CSSStylableElement ) {
120- CSSStylableElement element = (CSSStylableElement ) o ;
119+ if (o instanceof CSSStylableElement element ) {
121120 engine = WidgetElement .getEngine ((Widget ) element .getNativeWidget ());
122121 }
123122 if (engine == null && o instanceof Widget ) {
@@ -391,16 +390,13 @@ private Rectangle getBounds(Widget widget) {
391390 if (widget instanceof Shell ) {
392391 // Shell bounds are already in display coordinates
393392 return ((Shell ) widget ).getBounds ();
394- } else if (widget instanceof Control ) {
395- Control control = (Control ) widget ;
393+ } else if (widget instanceof Control control ) {
396394 Rectangle bounds = control .getBounds ();
397395 return control .getDisplay ().map (control .getParent (), null , bounds );
398- } else if (widget instanceof ToolItem ) {
399- ToolItem item = (ToolItem ) widget ;
396+ } else if (widget instanceof ToolItem item ) {
400397 Rectangle bounds = item .getBounds ();
401398 return item .getDisplay ().map (item .getParent (), null , bounds );
402- } else if (widget instanceof CTabItem ) {
403- CTabItem item = (CTabItem ) widget ;
399+ } else if (widget instanceof CTabItem item ) {
404400 Rectangle bounds = item .getBounds ();
405401 return item .getDisplay ().map (item .getParent (), null , bounds );
406402 }
0 commit comments