Bug 415076 - [event spy] uses invalid isEmpty()


Signed-off-by: Daniel Rolka <daniel.rolka@pl.ibm.com>
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 a360cd3..683643e 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 @@
 	}
 
 	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 5ddd718..49348fe 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 @@
 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 @@
 		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 @@
 		}
 
 		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 7e0b23e..602978f 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 @@
 		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 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 @@
 				}
 				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));
 					}
 				}