diff --git a/pmd/src/net/sourceforge/pmd/CPD.java b/pmd/src/net/sourceforge/pmd/CPD.java deleted file mode 100644 index 76a5f97dc5..0000000000 --- a/pmd/src/net/sourceforge/pmd/CPD.java +++ /dev/null @@ -1,225 +0,0 @@ -/* - * User: tom - * Date: Jul 26, 2002 - * Time: 8:43:19 PM - */ -package net.sourceforge.pmd; - -import java.io.File; -import java.io.IOException; -import java.io.FileReader; -import java.io.FilenameFilter; -import java.util.*; - -// this class will go away as soon -// as this spike is over -// i didn't want to create a new directory though -// since i'm not sure if this will work out - -public class CPD { - - public static class JavaFileOrDirectoryFilter implements FilenameFilter { - public boolean accept(File dir, String filename) { - return filename.endsWith("java") || (new File(dir.getAbsolutePath() + System.getProperty("file.separator") + filename).isDirectory()); - } - } - - public static class TokenPtr { - - private int location; - private File file; - private StringBuffer fileContents; - - public TokenPtr(File file, StringBuffer fileContents, int location) { - this.file = file; - this.location = location; - this.fileContents = fileContents; - } - - public boolean nextTokenAvailable(int imageLength) { - return (location+imageLength+1) < fileContents.length(); - } - - public String getNextCharacter(int imageLength) { - return String.valueOf(fileContents.charAt(location + imageLength)); - } - - } - - public static class TokenTable { - - // String->List (TokenPtr, TokenPtr, TokenPtr) - private Map tokens = new HashMap(); - private int minimumTokenSize; - private Set tokensFound = new HashSet(); - - private boolean stopAnyway = false; - private int lastTokenCount; - - public TokenTable(int minimumTokenSize) { - this.minimumTokenSize = minimumTokenSize; - } - - public void add(File file, StringBuffer code) { - for (int i=0; i