Comparing collections of different sizes transpose values
Brought to you by:
linkemario
When comparing two Collections of different length, the values in CompareResult are transposed if the collection passed in as object 1 is shorter. For example:
List one = new ArrayList();
one.add("first");
List two = new ArrayList();
two.add("first");
two.add("second");
CompareResult[] results = new ObjectUtil().compareAll(one,two);
In this case results[0].differentValue1 == "second", and results[0].differentValue2 == null
I've attached a test case to expose this behaviour and a patch to fix it.
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
JUnit test and Patch
Is this realy a bug? The result is the different value on the position 1 in the list (differentPath = [1] and differentValue: second <> null).
best regards
Maro