RFR: 1542: Census Namespace missing hashCode and equals
Joe Darcy
darcy at openjdk.org
Thu Aug 11 21:28:13 UTC 2022
On Thu, 11 Aug 2022 20:40:10 GMT, Erik Joelsson <erikj at openjdk.org> wrote:
> The Namespace class is missing hashCode and equals. This patch adds implementations for those two methods. The other data classes in the Census module already have them.
>
> This is preventing the change in [SKARA-1529](https://bugs.openjdk.org/browse/SKARA-1529) from actually taking effect, as we can't compare two instances of Namespace to see if they have the same contents.
Marked as reviewed by darcy (Reviewer).
census/src/main/java/org/openjdk/skara/census/Namespace.java line 100:
> 98: return true;
> 99: }
> 100: if (o == null || getClass() != o.getClass()) {
The "same type" check could be phrased differently using instanceof, but what you have here should work okay too.
-------------
PR: https://git.openjdk.org/skara/pull/1356
More information about the skara-dev
mailing list