Skip to content

java.lang.AssertionError: Significant fields: hashCode relies on serialVersionUID, but equals does not. These objects are equal, but probably shouldn't be: #159

@xenoterracide

Description

@xenoterracide

I can add more details later if necessary, I can't find a direct call to hashing serialVersionUID, I'm guessing this happens because of Serializable, by java itself.

private static final long serialVersionUID = 4492014110145565010L;

    /* super, and super of Super is object
        @Override
public int hashCode()
{
    return isNew() ? super.hashCode() : Objects.hashCode( getId() );
}
    */

@Override
public final int hashCode()
{
    return Objects.hash( super.hashCode(), id, external, display, integrationType );
}

@Test
public void testEquals() {
    EqualsVerifier.forClass( Integration.class )
        .withRedefinedSuperclass()
        .withOnlyTheseFields( "id", "external", "display", "integrationType" )
        .verify();
}

tried adding it to equals inside of the instanceof but that doesn't help

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions