Correct ordering of PatchLineComments in ChangeNotes

The ordering of the comment comparator in ChangeNotes should match the
ordering defined in the PatchLineCommentAccess (compare filename, then
line number, then writtenOn).

Change-Id: Icc96f807f6e8a954f9e0a922e777278cb86a3bf1
This commit is contained in:
Yacob Yonas
2014-07-15 13:54:05 -07:00
parent f36b3e2c8d
commit 512448049d

View File

@@ -103,8 +103,8 @@ public class ChangeNotes extends AbstractChangeNotes<ChangeNotes> {
String filename1 = c1.getKey().getParentKey().get();
String filename2 = c2.getKey().getParentKey().get();
return ComparisonChain.start()
.compare(c1.getLine(), c2.getLine())
.compare(filename1, filename2)
.compare(c1.getLine(), c2.getLine())
.compare(c1.getWrittenOn(), c2.getWrittenOn())
.result();
}