Skip to content

RefCollections do not implement equals and hashCode correctly #8

@tpietzsch

Description

@tpietzsch

None of the IntBackedRefCollections implement equals() and hashCode() as would be correct for java.util Collections. (See for example https://docs.oracle.com/javase/8/docs/api/java/util/Set.html#equals-java.lang.Object-)

Doing this right is difficult and requires that we define some conventions.

It could be relatively easy if we define that for PoolObjects equality always means "the same object in the same pool", that is, we make PoolObject.equals() and PoolObject.hashCode() final.

This came up, because this not-so-nice workaround is required to compare a two Set<Set<T>> for equality, which should in principle just be Set.equals().

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions