projects
/
deliverable
/
tracecompass.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added some more JUnit tests
[deliverable/tracecompass.git]
/
org.eclipse.linuxtools.lttng.ui
/
src
/
org
/
eclipse
/
linuxtools
/
lttng
/
ui
/
views
/
control
/
model
/
impl
/
TraceInfo.java
diff --git
a/org.eclipse.linuxtools.lttng.ui/src/org/eclipse/linuxtools/lttng/ui/views/control/model/impl/TraceInfo.java
b/org.eclipse.linuxtools.lttng.ui/src/org/eclipse/linuxtools/lttng/ui/views/control/model/impl/TraceInfo.java
index 5ae5e2e0f00da1439031ca183a94160d69b532d0..851478ff996316f5b68414cb6237198d10941d61 100644
(file)
--- a/
org.eclipse.linuxtools.lttng.ui/src/org/eclipse/linuxtools/lttng/ui/views/control/model/impl/TraceInfo.java
+++ b/
org.eclipse.linuxtools.lttng.ui/src/org/eclipse/linuxtools/lttng/ui/views/control/model/impl/TraceInfo.java
@@
-77,16
+77,25
@@
public class TraceInfo implements ITraceInfo {
fName = name;
}
fName = name;
}
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.linuxtools.lttng.ui.views.control.model.ITraceInfo#formatString()
+ */
+ @Override
+ public String formatString() {
+ return toString();
+ }
+
/*
* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
/*
* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
- if (fName == null) {
-
return 17
;
- }
- return
fName.hashCode()
;
+ final int prime = 31;
+
int result = 1
;
+ result = prime * result + ((fName == null) ? 0 : fName.hashCode());
+ return
result
;
}
/*
}
/*
@@
-94,15
+103,26
@@
public class TraceInfo implements ITraceInfo {
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
- public boolean equals(Object other) {
- if (!(other instanceof TraceInfo)) {
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
return false;
}
return false;
}
-
- TraceInfo otherInfo = (TraceInfo) other;
- return fName.equals(otherInfo.fName);
- }
-
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ TraceInfo other = (TraceInfo) obj;
+ if (fName == null) {
+ if (other.fName != null) {
+ return false;
+ }
+ } else if (!fName.equals(other.fName)) {
+ return false;
+ }
+ return true;
+ }
/*
* (non-Javadoc)
* @see java.lang.Object#toString()
/*
* (non-Javadoc)
* @see java.lang.Object#toString()
This page took
0.024047 seconds
and
5
git commands to generate.