RFR: 8203035: Implement equals() and hashCode() for Throwable

Stuart Marks smarks at openjdk.org
Wed Jan 18 01:55:21 UTC 2023


On Sat, 10 Dec 2022 18:11:30 GMT, Victor Toni <duke at openjdk.org> wrote:

> Being able to compare instances of Throwable allows simple detection of exceptions raised by the same circumstances. Comparison allows for reduction of excessive logging e.g. in hotspots without requiring custom code to compare Throwables.

I've closed [JDK-8203035](https://bugs.openjdk.org/browse/JDK-8203035) as Won't Fix; see comments there. Based on that analysis I recommend that we not proceed with this PR.

Briefly, I'd recommend that you implement your own logic for reducing logging messages based on "duplicate" exceptions. The logic for detecting duplicate exceptions is most likely application-specific and thus probably doesn't belong in the JDK.

-------------

PR: https://git.openjdk.org/jdk/pull/11624


More information about the core-libs-dev mailing list