New TraceSegmentRef.equals/hashCode.

This commit is contained in:
wusheng 2017-03-20 17:49:57 +08:00
parent baf9bf6942
commit 4a2104d25e
1 changed files with 3 additions and 4 deletions

View File

@ -86,7 +86,6 @@ public class TraceSegmentRef{
'}';
}
@Override
public boolean equals(Object o) {
if (this == o)
@ -96,15 +95,15 @@ public class TraceSegmentRef{
TraceSegmentRef ref = (TraceSegmentRef)o;
if (traceSegmentId != null ? !traceSegmentId.equals(ref.traceSegmentId) : ref.traceSegmentId != null)
if (spanId != ref.spanId)
return false;
return applicationCode != null ? applicationCode.equals(ref.applicationCode) : ref.applicationCode == null;
return traceSegmentId != null ? traceSegmentId.equals(ref.traceSegmentId) : ref.traceSegmentId == null;
}
@Override
public int hashCode() {
int result = traceSegmentId != null ? traceSegmentId.hashCode() : 0;
result = 31 * result + (applicationCode != null ? applicationCode.hashCode() : 0);
result = 31 * result + spanId;
return result;
}
}