Change-Id: I2ad81fc94b2253a96289ca13cc9ed4ef6954a6c4
Signed-off-by: Patrick Tasse <patrick.tasse@gmail.com>
Reviewed-on: https://git.eclipse.org/r/71820
Reviewed-by: Hudson CI
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
@Override
public int compare(ITimeGraphEntry o1, ITimeGraphEntry o2) {
- ThreadEntry t1 = (ThreadEntry) o1;
- ThreadEntry t2 = (ThreadEntry) o2;
- return reverse ? Long.compare(t2.getThreadId(), t1.getThreadId()) :
+ if (o1 instanceof ThreadEntry && o2 instanceof ThreadEntry) {
+ ThreadEntry t1 = (ThreadEntry) o1;
+ ThreadEntry t2 = (ThreadEntry) o2;
+ return reverse ? Long.compare(t2.getThreadId(), t1.getThreadId()) :
Long.compare(t1.getThreadId(), t2.getThreadId());
+ }
+ return 0;
}
}