Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Tasse2015-01-15 18:36:04 +0000
committerPatrick Tasse2015-01-19 15:33:25 +0000
commit157a89b4592ea5223a66cc162740672a44758aff (patch)
tree9c0195afd2dd7b3cf09c2705b464853c7e08d922
parent68398bcbc5e6c75152f6aa4f8a545cec6216b1c2 (diff)
downloadorg.eclipse.linuxtools-157a89b4592ea5223a66cc162740672a44758aff.tar.gz
org.eclipse.linuxtools-157a89b4592ea5223a66cc162740672a44758aff.tar.xz
org.eclipse.linuxtools-157a89b4592ea5223a66cc162740672a44758aff.zip
tmf: Bug 457502: Filter node elements should not implement equals()
Change-Id: I7f2c6d92b6c316d14bb51608f7429d5e4b94d905 Signed-off-by: Patrick Tasse <patrick.tasse@gmail.com> Reviewed-on: https://git.eclipse.org/r/39710 Tested-by: Hudson CI Reviewed-by: Bernd Hufmann <bernd.hufmann@ericsson.com> Tested-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/filter/model/TmfFilterAndNode.java30
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/filter/model/TmfFilterCompareNode.java53
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/filter/model/TmfFilterContainsNode.java48
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/filter/model/TmfFilterEqualsNode.java49
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/filter/model/TmfFilterEventTypeNode.java40
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/filter/model/TmfFilterMatchesNode.java44
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/filter/model/TmfFilterNode.java32
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/filter/model/TmfFilterOrNode.java28
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/filter/model/TmfFilterTreeNode.java32
9 files changed, 9 insertions, 347 deletions
diff --git a/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/filter/model/TmfFilterAndNode.java b/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/filter/model/TmfFilterAndNode.java
index 6aaef336d4..c384f90f4b 100644
--- a/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/filter/model/TmfFilterAndNode.java
+++ b/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/filter/model/TmfFilterAndNode.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2012 Ericsson
+ * Copyright (c) 2010, 2015 Ericsson
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
@@ -14,7 +14,6 @@ package org.eclipse.linuxtools.tmf.core.filter.model;
import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
-
/**
* Filter node for the 'and' operation
*
@@ -86,31 +85,4 @@ public class TmfFilterAndNode extends TmfFilterTreeNode {
}
return buf.toString();
}
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = super.hashCode();
- result = prime * result + (fNot ? 1231 : 1237);
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (!super.equals(obj)) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- TmfFilterAndNode other = (TmfFilterAndNode) obj;
- if (fNot != other.fNot) {
- return false;
- }
- return true;
- }
-
}
diff --git a/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/filter/model/TmfFilterCompareNode.java b/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/filter/model/TmfFilterCompareNode.java
index 0037532e93..5561e1462a 100644
--- a/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/filter/model/TmfFilterCompareNode.java
+++ b/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/filter/model/TmfFilterCompareNode.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2014 Ericsson
+ * Copyright (c) 2010, 2015 Ericsson
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
@@ -20,7 +20,6 @@ import java.util.List;
import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimestamp;
-
/**
* Filter node for the comparison operation
*
@@ -217,54 +216,4 @@ public class TmfFilterCompareNode extends TmfFilterTreeNode {
clone.setValue(fValue);
return clone;
}
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = super.hashCode();
- result = prime * result + ((fField == null) ? 0 : fField.hashCode());
- result = prime * result + (fNot ? 1231 : 1237);
- result = prime * result + fResult;
- result = prime * result + ((fType == null) ? 0 : fType.hashCode());
- result = prime * result + ((fValue == null) ? 0 : fValue.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (!super.equals(obj)) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- TmfFilterCompareNode other = (TmfFilterCompareNode) obj;
- if (fField == null) {
- if (other.fField != null) {
- return false;
- }
- } else if (!fField.equals(other.fField)) {
- return false;
- }
- if (fNot != other.fNot) {
- return false;
- }
- if (fResult != other.fResult) {
- return false;
- }
- if (fType != other.fType) {
- return false;
- }
- if (fValue == null) {
- if (other.fValue != null) {
- return false;
- }
- } else if (!fValue.equals(other.fValue)) {
- return false;
- }
- return true;
- }
}
diff --git a/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/filter/model/TmfFilterContainsNode.java b/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/filter/model/TmfFilterContainsNode.java
index 798787d623..39e9323fdf 100644
--- a/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/filter/model/TmfFilterContainsNode.java
+++ b/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/filter/model/TmfFilterContainsNode.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2013 Ericsson
+ * Copyright (c) 2010, 2015 Ericsson
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
@@ -139,50 +139,4 @@ public class TmfFilterContainsNode extends TmfFilterTreeNode {
clone.setValue(fValue);
return clone;
}
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = super.hashCode();
- result = prime * result + ((fField == null) ? 0 : fField.hashCode());
- result = prime * result + (fIgnoreCase ? 1231 : 1237);
- result = prime * result + (fNot ? 1231 : 1237);
- result = prime * result + ((fValue == null) ? 0 : fValue.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (!super.equals(obj)) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- TmfFilterContainsNode other = (TmfFilterContainsNode) obj;
- if (fField == null) {
- if (other.fField != null) {
- return false;
- }
- } else if (!fField.equals(other.fField)) {
- return false;
- }
- if (fIgnoreCase != other.fIgnoreCase) {
- return false;
- }
- if (fNot != other.fNot) {
- return false;
- }
- if (fValue == null) {
- if (other.fValue != null) {
- return false;
- }
- } else if (!fValue.equals(other.fValue)) {
- return false;
- }
- return true;
- }
}
diff --git a/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/filter/model/TmfFilterEqualsNode.java b/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/filter/model/TmfFilterEqualsNode.java
index a85a43a598..946d0c7494 100644
--- a/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/filter/model/TmfFilterEqualsNode.java
+++ b/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/filter/model/TmfFilterEqualsNode.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2013 Ericsson
+ * Copyright (c) 2010, 2015 Ericsson
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
@@ -17,7 +17,6 @@ import java.util.List;
import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
-
/**
* Filter node for the '==' operation
*
@@ -139,50 +138,4 @@ public class TmfFilterEqualsNode extends TmfFilterTreeNode {
clone.fValue = fValue;
return clone;
}
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = super.hashCode();
- result = prime * result + ((fField == null) ? 0 : fField.hashCode());
- result = prime * result + (fIgnoreCase ? 1231 : 1237);
- result = prime * result + (fNot ? 1231 : 1237);
- result = prime * result + ((fValue == null) ? 0 : fValue.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (!super.equals(obj)) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- TmfFilterEqualsNode other = (TmfFilterEqualsNode) obj;
- if (fField == null) {
- if (other.fField != null) {
- return false;
- }
- } else if (!fField.equals(other.fField)) {
- return false;
- }
- if (fIgnoreCase != other.fIgnoreCase) {
- return false;
- }
- if (fNot != other.fNot) {
- return false;
- }
- if (fValue == null) {
- if (other.fValue != null) {
- return false;
- }
- } else if (!fValue.equals(other.fValue)) {
- return false;
- }
- return true;
- }
}
diff --git a/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/filter/model/TmfFilterEventTypeNode.java b/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/filter/model/TmfFilterEventTypeNode.java
index 55bead9a1b..0abcedfde5 100644
--- a/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/filter/model/TmfFilterEventTypeNode.java
+++ b/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/filter/model/TmfFilterEventTypeNode.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2013 Ericsson
+ * Copyright (c) 2010, 2015 Ericsson
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
@@ -26,44 +26,6 @@ import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
@SuppressWarnings("javadoc")
public class TmfFilterEventTypeNode extends TmfFilterTreeNode {
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = super.hashCode();
- result = prime * result + ((fName == null) ? 0 : fName.hashCode());
- result = prime * result + ((fType == null) ? 0 : fType.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (!super.equals(obj)) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- TmfFilterEventTypeNode other = (TmfFilterEventTypeNode) obj;
- if (fName == null) {
- if (other.fName != null) {
- return false;
- }
- } else if (!fName.equals(other.fName)) {
- return false;
- }
- if (fType == null) {
- if (other.fType != null) {
- return false;
- }
- } else if (!fType.equals(other.fType)) {
- return false;
- }
- return true;
- }
-
public static final String NODE_NAME = "EVENTTYPE"; //$NON-NLS-1$
public static final String TYPE_ATTR = "type"; //$NON-NLS-1$
public static final String NAME_ATTR = "name"; //$NON-NLS-1$
diff --git a/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/filter/model/TmfFilterMatchesNode.java b/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/filter/model/TmfFilterMatchesNode.java
index d32115762d..6efae7a7ec 100644
--- a/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/filter/model/TmfFilterMatchesNode.java
+++ b/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/filter/model/TmfFilterMatchesNode.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2013 Ericsson
+ * Copyright (c) 2010, 2015 Ericsson
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
@@ -151,46 +151,4 @@ public class TmfFilterMatchesNode extends TmfFilterTreeNode {
}
return ret;
}
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = super.hashCode();
- result = prime * result + ((fField == null) ? 0 : fField.hashCode());
- result = prime * result + (fNot ? 1231 : 1237);
- result = prime * result + ((fRegex == null) ? 0 : fRegex.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (!super.equals(obj)) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- TmfFilterMatchesNode other = (TmfFilterMatchesNode) obj;
- if (fField == null) {
- if (other.fField != null) {
- return false;
- }
- } else if (!fField.equals(other.fField)) {
- return false;
- }
- if (fNot != other.fNot) {
- return false;
- }
- if (fRegex == null) {
- if (other.fRegex != null) {
- return false;
- }
- } else if (!fRegex.equals(other.fRegex)) {
- return false;
- }
- return true;
- }
}
diff --git a/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/filter/model/TmfFilterNode.java b/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/filter/model/TmfFilterNode.java
index 59ae9c2728..d69256a138 100644
--- a/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/filter/model/TmfFilterNode.java
+++ b/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/filter/model/TmfFilterNode.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2013 Ericsson
+ * Copyright (c) 2010, 2015 Ericsson
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
@@ -104,34 +104,4 @@ public class TmfFilterNode extends TmfFilterTreeNode {
}
return buf.toString();
}
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = super.hashCode();
- result = prime * result + ((fFilterName == null) ? 0 : fFilterName.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (!super.equals(obj)) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- TmfFilterNode other = (TmfFilterNode) obj;
- if (fFilterName == null) {
- if (other.fFilterName != null) {
- return false;
- }
- } else if (!fFilterName.equals(other.fFilterName)) {
- return false;
- }
- return true;
- }
}
diff --git a/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/filter/model/TmfFilterOrNode.java b/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/filter/model/TmfFilterOrNode.java
index a8579e6e8d..b9f2cfa2b7 100644
--- a/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/filter/model/TmfFilterOrNode.java
+++ b/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/filter/model/TmfFilterOrNode.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2012 Ericsson
+ * Copyright (c) 2010, 2015 Ericsson
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
@@ -85,30 +85,4 @@ public class TmfFilterOrNode extends TmfFilterTreeNode {
}
return buf.toString();
}
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = super.hashCode();
- result = prime * result + (fNot ? 1231 : 1237);
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (!super.equals(obj)) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- TmfFilterOrNode other = (TmfFilterOrNode) obj;
- if (fNot != other.fNot) {
- return false;
- }
- return true;
- }
}
diff --git a/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/filter/model/TmfFilterTreeNode.java b/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/filter/model/TmfFilterTreeNode.java
index 6bf7f5f1df..f2703e6597 100644
--- a/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/filter/model/TmfFilterTreeNode.java
+++ b/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/filter/model/TmfFilterTreeNode.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2013 Ericsson
+ * Copyright (c) 2010, 2015 Ericsson
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
@@ -231,34 +231,4 @@ public abstract class TmfFilterTreeNode implements ITmfFilterTreeNode, Cloneable
return null;
}
}
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((children == null) ? 0 : children.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- TmfFilterTreeNode other = (TmfFilterTreeNode) obj;
- if (children == null) {
- if (other.children != null) {
- return false;
- }
- } else if (!children.equals(other.children)) {
- return false;
- }
- return true;
- }
}

Back to the top