< prev index next >

src/share/classes/javax/swing/plaf/synth/SynthTreeUI.java

Print this page
rev 1580 : 6727661: Code improvement and warnings removing from the swing/plaf packages
Summary: Removed unnecessary castings and other warnings
Reviewed-by: alexp
Contributed-by: Florian Brunner <fbrunnerlist@gmx.ch>

@@ -409,11 +409,11 @@
             g.fillRect(rect.x, rect.y, rect.width, rect.height);
         }
     }
 
     private Rectangle getDropLineRect(JTree.DropLocation loc) {
-        Rectangle rect = null;
+        Rectangle rect;
         TreePath path = loc.getPath();
         int index = loc.getChildIndex();
         boolean ltr = tree.getComponentOrientation().isLeftToRight();
 
         Insets insets = tree.getInsets();

@@ -546,11 +546,11 @@
                TreePath path, int row, boolean isExpanded,
                boolean hasBeenExpanded, boolean isLeaf) {
         // Don't paint the renderer if editing this row.
         boolean selected = tree.isRowSelected(row);
 
-        JTree.DropLocation dropLocation = (JTree.DropLocation)tree.getDropLocation();
+        JTree.DropLocation dropLocation = tree.getDropLocation();
         boolean isDrop = dropLocation != null
                          && dropLocation.getChildIndex() == -1
                          && path == dropLocation.getPath();
 
         int state = ENABLED;
< prev index next >