From e462839a1ad09e03e08ffb81590e4347ff2b89a1 Mon Sep 17 00:00:00 2001 From: Tom Copeland Date: Tue, 25 Oct 2005 19:16:39 +0000 Subject: [PATCH] This might be useful for IDE plugins; I'm using it in the JBuilder plugin git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@3943 51baf565-9d33-0410-a72c-fc3788e3496d --- .../sourceforge/pmd/cpd/MatchLengthComparator.java | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 pmd/src/net/sourceforge/pmd/cpd/MatchLengthComparator.java 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(); + } +}