diff options
author | Daniel Rolka | 2013-08-14 15:32:25 +0000 |
---|---|---|
committer | Daniel Rolka | 2013-08-14 15:33:40 +0000 |
commit | e0154e95cd072a798b3a5eb664bc276490ccbe12 (patch) | |
tree | 739ed1a01ca243202dccd59757e26561498f8e3c | |
parent | 0b5f24fa4c7134bf901e387289303c75678784ca (diff) | |
download | org.eclipse.e4.tools-e0154e95cd072a798b3a5eb664bc276490ccbe12.tar.gz org.eclipse.e4.tools-e0154e95cd072a798b3a5eb664bc276490ccbe12.tar.xz org.eclipse.e4.tools-e0154e95cd072a798b3a5eb664bc276490ccbe12.zip |
Bug 415076 - [event spy] uses invalid isEmpty()I20130822-2200I20130821-2200I20130821-0900I20130820-2200I20130819-2200I20130818-2200I20130817-2200I20130816-2200I20130815-2200I20130814-2200
Signed-off-by: Daniel Rolka <daniel.rolka@pl.ibm.com>
3 files changed, 8 insertions, 8 deletions
diff --git a/bundles/org.eclipse.e4.tools.event.spy/src/org/eclipse/e4/tools/event/spy/core/CapturedEventFilterMatcher.java b/bundles/org.eclipse.e4.tools.event.spy/src/org/eclipse/e4/tools/event/spy/core/CapturedEventFilterMatcher.java index a360cd33..683643e7 100644 --- a/bundles/org.eclipse.e4.tools.event.spy/src/org/eclipse/e4/tools/event/spy/core/CapturedEventFilterMatcher.java +++ b/bundles/org.eclipse.e4.tools.event.spy/src/org/eclipse/e4/tools/event/spy/core/CapturedEventFilterMatcher.java @@ -103,7 +103,7 @@ public class CapturedEventFilterMatcher { } private boolean matchesToEmptyString(Object current) { - return current != null && current instanceof String && current.toString().isEmpty(); + return current != null && current instanceof String && current.toString().length() == 0; } private boolean matchesToNull(Object current) { diff --git a/bundles/org.eclipse.e4.tools.event.spy/src/org/eclipse/e4/tools/event/spy/ui/CapturedEventFilters.java b/bundles/org.eclipse.e4.tools.event.spy/src/org/eclipse/e4/tools/event/spy/ui/CapturedEventFilters.java index 5ddd7187..49348fec 100644 --- a/bundles/org.eclipse.e4.tools.event.spy/src/org/eclipse/e4/tools/event/spy/ui/CapturedEventFilters.java +++ b/bundles/org.eclipse.e4.tools.event.spy/src/org/eclipse/e4/tools/event/spy/ui/CapturedEventFilters.java @@ -39,7 +39,7 @@ import org.eclipse.swt.widgets.ToolTip; public class CapturedEventFilters { private final static String NOT_SELECTED_VALUE = "-- expected value --"; - private Composite control; + private final Composite control; private Text valueText; @@ -111,7 +111,7 @@ public class CapturedEventFilters { valueText.setText(NOT_SELECTED_VALUE); valueText.addFocusListener(new FocusListener() { public void focusLost(FocusEvent e) { - if (valueText.getText().trim().isEmpty()) { + if (valueText.getText().trim().length() == 0) { valueText.setText(NOT_SELECTED_VALUE); } } @@ -194,7 +194,7 @@ public class CapturedEventFilters { } String value = valueText.getText(); - if (value.isEmpty() || value.equals(NOT_SELECTED_VALUE)) { + if (value.length() == 0 || value.equals(NOT_SELECTED_VALUE)) { getTooltip().setText(String.format("%s is empty", getFieldName(NOT_SELECTED_VALUE))); getTooltip().setVisible(true); return; diff --git a/bundles/org.eclipse.e4.tools.event.spy/src/org/eclipse/e4/tools/event/spy/ui/CapturedEventTree.java b/bundles/org.eclipse.e4.tools.event.spy/src/org/eclipse/e4/tools/event/spy/ui/CapturedEventTree.java index 7e0b23e7..602978f5 100644 --- a/bundles/org.eclipse.e4.tools.event.spy/src/org/eclipse/e4/tools/event/spy/ui/CapturedEventTree.java +++ b/bundles/org.eclipse.e4.tools.event.spy/src/org/eclipse/e4/tools/event/spy/ui/CapturedEventTree.java @@ -38,11 +38,11 @@ public class CapturedEventTree { void selectionChanged(CapturedEventTreeSelection selection); } - private Tree tree; + private final Tree tree; private SelectionListener selectionListener; - private List<ItemToFilter> columns = new ArrayList<ItemToFilter>(); + private final List<ItemToFilter> columns = new ArrayList<ItemToFilter>(); /* Layout scheme: @@ -84,7 +84,7 @@ public class CapturedEventTree { public void treeExpanded(TreeEvent e) { TreeItem item = (TreeItem) e.item; TreeItem paramItem = item.getItem(0); - if (paramItem.getText().isEmpty()) { + if (paramItem.getText().length() == 0) { for (Parameter param: (List<Parameter>) paramItem.getData()) { if (paramItem == null) { paramItem = new TreeItem(item, SWT.NONE); @@ -120,7 +120,7 @@ public class CapturedEventTree { } if (selectedItemIndex >= 0 && selectionListener != null) { String selection = items[0].getText(selectedItemIndex); - if (!selection.isEmpty()) { + if (selection.length() != 0) { selectionListener.selectionChanged(new CapturedEventTreeSelection(selection,items[0].getItemCount() == 0)); } } |