diff --git a/pmd/src/net/sourceforge/pmd/cpd/MatchLengthComparator.java b/pmd/src/net/sourceforge/pmd/cpd/MatchLengthComparator.java new file mode 100644 index 0000000000..83e9233db5 --- /dev/null +++ b/pmd/src/net/sourceforge/pmd/cpd/MatchLengthComparator.java @@ -0,0 +1,11 @@ +package net.sourceforge.pmd.cpd; + +import java.util.Comparator; + +public class MatchLengthComparator implements Comparator { + public int compare(Object o1, Object o2) { + Match m1 = (Match)o1; + Match m2 = (Match)o2; + return m2.getLineCount() - m1.getLineCount(); + } +}