changeset 8025:351df31aa086

[SCENEBUILDER] Fixed FindBugs warnings. This also fix DTL-6866: Assertion error when adding ButtonTypes to a DialogPane
author Jerome Cambon
date Wed, 10 Sep 2014 10:47:58 +0200
parents bace5fdce0fe
children d02883b88ce5
files apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/editor/panel/inspector/editors/ButtonTypeEditor.java
diffstat 1 files changed, 5 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/editor/panel/inspector/editors/ButtonTypeEditor.java	Tue Sep 09 18:46:35 2014 -0600
+++ b/apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/editor/panel/inspector/editors/ButtonTypeEditor.java	Wed Sep 10 10:47:58 2014 +0200
@@ -111,13 +111,8 @@
     }
 
     private Comparator<ButtonType> getButtonTypeComparator() {
-        return new Comparator<ButtonType>() {
-
-            @Override
-            public int compare(ButtonType bt1, ButtonType bt2) {
-                return bt1.getText().compareTo(bt2.getText());
-            }
-        };
+        Comparator<ButtonType> comparator = (ButtonType bt1, ButtonType bt2) -> bt1.getText().compareTo(bt2.getText());
+        return comparator;
     }
 
     @Override
@@ -126,11 +121,11 @@
         // Group all the item values in a list
         for (EditorItem buttonTypeItem : getEditorItems()) {
             Object itemValueObj = buttonTypeItem.getValue();
+            if (itemValueObj == null) {
+                continue;
+            }
             assert itemValueObj instanceof ButtonType;
             ButtonType itemValue = (ButtonType) itemValueObj;
-            if (itemValue == null) {
-                continue;
-            }
             value.add(itemValue);
         }
         if (value.isEmpty()) {