mirror of
https://github.com/corda/corda.git
synced 2025-01-22 12:28:11 +00:00
implement a few StackTraceElement methods
This commit is contained in:
parent
efb4e0241b
commit
819588546e
@ -27,6 +27,34 @@ public class StackTraceElement {
|
||||
this.line = line;
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return class_.hashCode() ^ method.hashCode() ^ line;
|
||||
}
|
||||
|
||||
public boolean equals(Object o) {
|
||||
if (o instanceof StackTraceElement) {
|
||||
StackTraceElement e = (StackTraceElement) o;
|
||||
return class_.equals(e.class_)
|
||||
&& method.equals(e.method)
|
||||
&& line == e.line;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(class_).append(".").append(method);
|
||||
|
||||
if (line == NativeLine) {
|
||||
sb.append(" (native)");
|
||||
} else if (line >= 0) {
|
||||
sb.append(" (line ").append(line).append(")");
|
||||
}
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public String getClassName() {
|
||||
return class_;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user