X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=org.eclipse.linuxtools.lttng.ui%2Fsrc%2Forg%2Feclipse%2Flinuxtools%2Flttng%2Fui%2Fviews%2Fcontrol%2Fmodel%2Fimpl%2FBaseEventInfo.java;h=b374e9446df005ec5fceadcc9e41883e42897f9c;hb=d132bcc71fa0ff07cf2a3f0b6258f38abb546fb7;hp=098fc5d9b0b6275486879b4eb0115053ba3b871e;hpb=f1e23c542e9b00f6dab15b7aa2960315a22d9bc4;p=deliverable%2Ftracecompass.git diff --git a/org.eclipse.linuxtools.lttng.ui/src/org/eclipse/linuxtools/lttng/ui/views/control/model/impl/BaseEventInfo.java b/org.eclipse.linuxtools.lttng.ui/src/org/eclipse/linuxtools/lttng/ui/views/control/model/impl/BaseEventInfo.java index 098fc5d9b0..b374e9446d 100644 --- a/org.eclipse.linuxtools.lttng.ui/src/org/eclipse/linuxtools/lttng/ui/views/control/model/impl/BaseEventInfo.java +++ b/org.eclipse.linuxtools.lttng.ui/src/org/eclipse/linuxtools/lttng/ui/views/control/model/impl/BaseEventInfo.java @@ -155,43 +155,67 @@ public class BaseEventInfo extends TraceInfo implements IBaseEventInfo { } } + /* + * (non-Javadoc) + * @see org.eclipse.linuxtools.lttng.ui.views.control.model.ITraceInfo#formatString() + */ + @SuppressWarnings("nls") + @Override + public String formatString() { + StringBuffer output = new StringBuffer(); + // ust_tests_hello:tptest_sighandler (loglevel: TRACE_DEBUG_MODULE (10)) (type: tracepoint)"); + output.append("\n "); + output.append(getName()); + if (fLogLevel != TraceLogLevel.LEVEL_UNKNOWN) { + output.append(" (loglevel: "); + output.append(fLogLevel.getInName()); + output.append(" ("); + output.append(fLogLevel.ordinal()); + output.append("))"); + } + output.append(" (type: "); + output.append(fEventType.getInName()); + output.append(")"); + return output.toString(); + } + /* * (non-Javadoc) * @see org.eclipse.linuxtools.lttng.ui.views.control.model.impl.TraceInfo#hashCode() */ @Override public int hashCode() { - int result = 17; - result = 37 * result + super.hashCode(); - result = 37 * result + fEventType.ordinal(); - result = 37 * result + fLogLevel.ordinal(); + final int prime = 31; + int result = super.hashCode(); + result = prime * result + ((fEventType == null) ? 0 : (fEventType.ordinal() + 1)); + result = prime * result + ((fLogLevel == null) ? 0 : (fLogLevel.ordinal() + 1)); return result; - } + } /* * (non-Javadoc) * @see org.eclipse.linuxtools.lttng.ui.views.control.model.impl.TraceInfo#equals(java.lang.Object) */ @Override - public boolean equals(Object other) { - if (!(other instanceof BaseEventInfo)) { + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!super.equals(obj)) { return false; } - - BaseEventInfo otherInfo = (BaseEventInfo) other; - if (!super.equals(otherInfo)) { + if (getClass() != obj.getClass()) { return false; } - - if (fEventType.ordinal() != otherInfo.fEventType.ordinal()) { + BaseEventInfo other = (BaseEventInfo) obj; + if (fEventType != other.fEventType) { return false; } - - if (fLogLevel.ordinal() != otherInfo.fLogLevel.ordinal()) { + if (fLogLevel != other.fLogLevel) { return false; } return true; - } + } /* * (non-Javadoc) @@ -210,4 +234,8 @@ public class BaseEventInfo extends TraceInfo implements IBaseEventInfo { output.append(")]"); return output.toString(); } + + + + } \ No newline at end of file