IllegalArgumentException on id (d != java.lang.String)

55 views
Skip to first unread message

Thiago Augusto V. Lima

unread,
Jul 6, 2010, 12:02:34 AM7/6/10
to equalsverifier
What could be causing this error/backtrace?

Caught IllegalArgumentException on id (d != java.lang.String)
junit.framework.AssertionFailedError: Caught IllegalArgumentException
on id (d != java.lang.String)
at nl.jqno.equalsverifier.util.Assert.fail(Assert.java:96)
at
nl.jqno.equalsverifier.EqualsVerifier.verify(EqualsVerifier.java:310)
at mysw.base.pessoa.EnderecoTest.testEquals(EnderecoTest.java:
349)

I implemented Endereco.equals(Object o) accordingly to Richard Jepps
suggestion @ http://tal.forum2.org/equals

Any clue?


Thanks in advance

jqno

unread,
Jul 6, 2010, 11:00:13 AM7/6/10
to equalsverifier
Hi Thiago,

EqualsVerifier uses reflection to instantiate your class and give
values to its fields. From the error message, I think it tries to give
the field "id" a String value, which apparently fails. Unfortunately,
I can't tell you much more with just this information. If you call the
debug method on EqualsVerifier, it will write a more detailed
stacktrace to System.err, which may help you find the problem. If that
doesn't help, could you send me the source for the class you're
testing?

Regards,
Jan


On Jul 6, 6:02 am, "Thiago Augusto V. Lima" <t.augu...@gmail.com>
wrote:
> suggestion @http://tal.forum2.org/equals
Reply all
Reply to author
Forward
0 new messages