java.lang.AssertionError: Significant fields: equals does not use *field name*, or it is stateless.

71 views
Skip to first unread message

Salam Ahmed

unread,
Mar 8, 2019, 5:29:59 AM3/8/19
to equalsverifier
Hi,

I have a bunch of fields in the superclass and I need to include them all in EqualsVerifier.

I do not want to use .withOnlyTheseFields("bar", "baz") .


What should I do?



Best regards
Salam

Jan Ouwens

unread,
Mar 8, 2019, 6:21:12 AM3/8/19
to equalsv...@googlegroups.com, Salam Ahmed
Hi Salam,

EqualsVerifier automatically includes all fields it can find, including the ones in the superclass. `withOnlyTheseFields` has the emphasis on "only": all fields that you don't mention there should not be used.



Cheers,
Jan
--
You received this message because you are subscribed to the Google Groups "equalsverifier" group.
To unsubscribe from this group and stop receiving emails from it, send an email to equalsverifie...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages