#13 ListAssert.assertEquals should check size first, not last

CVS_code
open
nobody
7
2004-08-16
2004-08-16
No

ListAssert.assertEquals should check size first, not last.

Otherwise, you get an ArrayIndexOutOfBoundsException
if expected is larger than actual.

Either that, or handle the above case where
expected.size() = 1, and actual.size() = 0;

The cause of the error is this line in failNotContains
(String message, List actual, Object value)

listcontent.append(actual.get(actual.size() - 1));

which falsely assumes that actual has a non-zero size.

Another solution would be to fix failNotContains to
handle a zero-sized actual List.

Discussion

  • Mike Kienenberger

    • milestone: 230675 --> CVS_code
    • priority: 5 --> 7
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks