EqualsVerifier issue with Array of Enum values

55 views
Skip to first unread message

John Camerin

unread,
Oct 1, 2018, 12:27:49 PM10/1/18
to equalsverifier
I have a class with a member variable named channels which is an Array of enum values. When I use EqualsVerifier, I get the following error:

java.lang.AssertionError: Array: == or regular equals() used instead of Arrays.equals() for field channels.

I have tried using java.util.Objects.equals/deepEquals as well as java.util.Arrays.equals/deepEquals in my equals method and all result in this error. I havent found a workaround to this issue.  Attached is the source code for the class and enum.

EqualsVerifier throws the error on Line 293 of FieldsChecker when performing FieldInspector.check using ArrayFieldCheck. In stepping through the code, reference and changed are referring to the same enum value, but are different instances, which seems to be the issue.  See the screen shot below from the debugger.

Thanks in advance.


Screen Shot 2018-10-01 at 12.21.54 PM.png




ChannelDetails.java
ChannelType.java

John Camerin

unread,
Oct 1, 2018, 1:26:34 PM10/1/18
to equalsverifier
IGNORE!!  I found the bug in my code.  Thanks!
Reply all
Reply to author
Forward
0 new messages