-
Enhancement
-
Resolution: Won't Fix
-
P4
-
None
-
8, 9, 10, 11
A DESCRIPTION OF THE PROBLEM :
Since Throwable does not override equals() and hashCode() it's difficult to compare Exceptions with each other.
My use case is a "circuit breaker" for logging which keeps track of the logging message and its arguments. The issue is that no two logs from the same place match because the exceptions if compared don't result to be equal.
I have custom handling in place which works around this issue (by comparing detailMessage, stacktrace and cause "by hand") but it feels as if the better approach would be to be able to rely on the common contract of equals() / hashCode().
Properties of Throwable such as String and StackTraceElement already support equals() / hashCode().
Since Throwable does not override equals() and hashCode() it's difficult to compare Exceptions with each other.
My use case is a "circuit breaker" for logging which keeps track of the logging message and its arguments. The issue is that no two logs from the same place match because the exceptions if compared don't result to be equal.
I have custom handling in place which works around this issue (by comparing detailMessage, stacktrace and cause "by hand") but it feels as if the better approach would be to be able to rely on the common contract of equals() / hashCode().
Properties of Throwable such as String and StackTraceElement already support equals() / hashCode().
- links to
-
Review openjdk/jdk/11624