aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-duplications/src/main/java/net/sourceforge/pmd
diff options
context:
space:
mode:
authorEvgeny Mandrikov <mandrikov@gmail.com>2012-01-16 13:41:24 +0400
committerEvgeny Mandrikov <mandrikov@gmail.com>2012-01-16 13:59:09 +0400
commitff0901201f06ddf3a1af93b45dce89ab924d2143 (patch)
treecd9fcca6c5aaacc6fa95c8b4d00d90291e0f584f /sonar-duplications/src/main/java/net/sourceforge/pmd
parente5d8abcccd285c3b6798e882c173eafec14d7e31 (diff)
downloadsonarqube-ff0901201f06ddf3a1af93b45dce89ab924d2143.tar.gz
sonarqube-ff0901201f06ddf3a1af93b45dce89ab924d2143.zip
Fix violations
Diffstat (limited to 'sonar-duplications/src/main/java/net/sourceforge/pmd')
-rw-r--r--sonar-duplications/src/main/java/net/sourceforge/pmd/cpd/AbstractLanguage.java1
-rw-r--r--sonar-duplications/src/main/java/net/sourceforge/pmd/cpd/Language.java5
-rw-r--r--sonar-duplications/src/main/java/net/sourceforge/pmd/cpd/TokenEntry.java20
3 files changed, 14 insertions, 12 deletions
diff --git a/sonar-duplications/src/main/java/net/sourceforge/pmd/cpd/AbstractLanguage.java b/sonar-duplications/src/main/java/net/sourceforge/pmd/cpd/AbstractLanguage.java
index e3927589e67..7237e68d2e1 100644
--- a/sonar-duplications/src/main/java/net/sourceforge/pmd/cpd/AbstractLanguage.java
+++ b/sonar-duplications/src/main/java/net/sourceforge/pmd/cpd/AbstractLanguage.java
@@ -35,6 +35,7 @@ public abstract class AbstractLanguage implements Language {
/**
* @deprecated in 2.14, seems that not used in Sonar ecosystem - we don't scan directories.
*/
+ @Deprecated
public FilenameFilter getFileFilter() {
return fileFilter;
}
diff --git a/sonar-duplications/src/main/java/net/sourceforge/pmd/cpd/Language.java b/sonar-duplications/src/main/java/net/sourceforge/pmd/cpd/Language.java
index 12009cd6d0e..6b1e11c643c 100644
--- a/sonar-duplications/src/main/java/net/sourceforge/pmd/cpd/Language.java
+++ b/sonar-duplications/src/main/java/net/sourceforge/pmd/cpd/Language.java
@@ -29,7 +29,8 @@ public interface Language {
String fileSeparator = System.getProperty("file.separator");
- public Tokenizer getTokenizer();
+ Tokenizer getTokenizer();
+
+ FilenameFilter getFileFilter();
- public FilenameFilter getFileFilter();
}
diff --git a/sonar-duplications/src/main/java/net/sourceforge/pmd/cpd/TokenEntry.java b/sonar-duplications/src/main/java/net/sourceforge/pmd/cpd/TokenEntry.java
index 1976cefa619..fe1ef9e3f0c 100644
--- a/sonar-duplications/src/main/java/net/sourceforge/pmd/cpd/TokenEntry.java
+++ b/sonar-duplications/src/main/java/net/sourceforge/pmd/cpd/TokenEntry.java
@@ -28,6 +28,9 @@ import java.util.Map;
public class TokenEntry implements Comparable<TokenEntry> {
+ private final static Map<String, Integer> TOKENS = new HashMap<String, Integer>();
+ private static int tokenCount = 0;
+
public static final TokenEntry EOF = new TokenEntry();
private String tokenSrcID;
@@ -36,34 +39,31 @@ public class TokenEntry implements Comparable<TokenEntry> {
private int identifier;
private int hashCode;
- private final static Map<String, Integer> Tokens = new HashMap<String, Integer>();
- private static int TokenCount = 0;
-
private TokenEntry() {
this.identifier = 0;
this.tokenSrcID = "EOFMarker";
}
public TokenEntry(String image, String tokenSrcID, int beginLine) {
- Integer i = Tokens.get(image);
+ Integer i = TOKENS.get(image);
if (i == null) {
- i = Tokens.size() + 1;
- Tokens.put(image, i);
+ i = TOKENS.size() + 1;
+ TOKENS.put(image, i);
}
this.identifier = i.intValue();
this.tokenSrcID = tokenSrcID;
this.beginLine = beginLine;
- this.index = TokenCount++;
+ this.index = tokenCount++;
}
public static TokenEntry getEOF() {
- TokenCount++;
+ tokenCount++;
return EOF;
}
public static void clearImages() {
- Tokens.clear();
- TokenCount = 0;
+ TOKENS.clear();
+ tokenCount = 0;
}
public String getTokenSrcID() {