changeset 2140:d951ced300ac

[Findbugs] Dead store to oldDefault in com.sun.javafx.scene.control.skin.ButtonSkin.setCancelButton(boolean) Dead store to oldDefault in com.sun.javafx.scene.control.skin.ButtonSkin.setDefaultButton(boolean)
author jgiles
date Fri, 04 Jan 2013 17:34:35 +1300
parents f550745ae62f
children 91fb933bb1d2
files javafx-ui-controls/src/com/sun/javafx/scene/control/skin/ButtonSkin.java
diffstat 1 files changed, 3 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/ButtonSkin.java	Fri Jan 04 17:34:02 2013 +1300
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/ButtonSkin.java	Fri Jan 04 17:34:35 2013 +1300
@@ -122,7 +122,7 @@
         defaultAcceleratorKeyCodeCombination = 
                 new KeyCodeCombination(acceleratorCode);
 
-        if (value == false) {
+        if (! value) {
             /*
             ** first check of there's a default button already
             */
@@ -134,12 +134,6 @@
                 getSkinnable().getParent().getScene().getAccelerators().remove(defaultAcceleratorKeyCodeCombination);
             }
         }
-        else {
-            /*
-            ** first check of there's a default button already
-            */
-            Runnable oldDefault = getSkinnable().getParent().getScene().getAccelerators().get(defaultAcceleratorKeyCodeCombination);
-        }
         getSkinnable().getParent().getScene().getAccelerators().put(defaultAcceleratorKeyCodeCombination, defaultButtonRunnable);
     }
 
@@ -147,10 +141,9 @@
 
     private void setCancelButton(boolean value) {
         KeyCode acceleratorCode = KeyCode.ESCAPE;
-        cancelAcceleratorKeyCodeCombination =
-                new KeyCodeCombination(acceleratorCode);
+        cancelAcceleratorKeyCodeCombination = new KeyCodeCombination(acceleratorCode);
         
-        if (value == false) {
+        if (! value) {
             /*
             ** first check of there's a default button already
             */
@@ -161,12 +154,6 @@
                 */
                 getSkinnable().getParent().getScene().getAccelerators().remove(cancelAcceleratorKeyCodeCombination);
             }
-        }
-        else {
-            /*
-            ** first check of there's a default button already
-            */
-            Runnable oldDefault = getSkinnable().getParent().getScene().getAccelerators().get(cancelAcceleratorKeyCodeCombination);
         }        
         getSkinnable().getParent().getScene().getAccelerators().put(cancelAcceleratorKeyCodeCombination, cancelButtonRunnable);
     }