diff options
author | Evgeny Mandrikov <mandrikov@gmail.com> | 2012-02-17 12:48:07 +0400 |
---|---|---|
committer | Evgeny Mandrikov <mandrikov@gmail.com> | 2012-02-17 13:46:50 +0400 |
commit | 0aa289a5926819abf28961be3d2f1e772648e9fb (patch) | |
tree | 2b4e7df2d9c0c383ca532b57f59db3be5a991740 /sonar-duplications/src/main/java | |
parent | aa342c58f14c8bc402f69143e9451aaad878e6c3 (diff) | |
download | sonarqube-0aa289a5926819abf28961be3d2f1e772648e9fb.tar.gz sonarqube-0aa289a5926819abf28961be3d2f1e772648e9fb.zip |
Fix some quality flaws
Diffstat (limited to 'sonar-duplications/src/main/java')
4 files changed, 8 insertions, 9 deletions
diff --git a/sonar-duplications/src/main/java/net/sourceforge/pmd/cpd/SourceCode.java b/sonar-duplications/src/main/java/net/sourceforge/pmd/cpd/SourceCode.java index 794851b04d3..e0fa7964913 100644 --- a/sonar-duplications/src/main/java/net/sourceforge/pmd/cpd/SourceCode.java +++ b/sonar-duplications/src/main/java/net/sourceforge/pmd/cpd/SourceCode.java @@ -37,7 +37,7 @@ public class SourceCode { public static final String EOL = System.getProperty("line.separator", "\n"); - public static abstract class CodeLoader { + public abstract static class CodeLoader { private SoftReference<List<String>> code; public List<String> getCode() { 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 a615af964d3..868b8e2eeea 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 @@ -33,7 +33,7 @@ import java.util.Map; */ public class TokenEntry implements Comparable<TokenEntry> { - private final static Map<String, Integer> TOKENS = new HashMap<String, Integer>(); + private static final Map<String, Integer> TOKENS = new HashMap<String, Integer>(); private static int tokenCount = 0; /** diff --git a/sonar-duplications/src/main/java/org/sonar/duplications/cpd/MatchAlgorithm.java b/sonar-duplications/src/main/java/org/sonar/duplications/cpd/MatchAlgorithm.java index d9b5827a4bb..0b25bbcfca5 100644 --- a/sonar-duplications/src/main/java/org/sonar/duplications/cpd/MatchAlgorithm.java +++ b/sonar-duplications/src/main/java/org/sonar/duplications/cpd/MatchAlgorithm.java @@ -29,7 +29,7 @@ import java.util.*; public class MatchAlgorithm { - private final static int MOD = 37; + private static final int MOD = 37; private int lastHash; private int lastMod = 1; @@ -110,7 +110,6 @@ public class MatchAlgorithm { cpdListener.phaseUpdate(CPDListener.DONE); } - @SuppressWarnings("PMD.JumbledIncrementer") private Map<TokenEntry, Object> hash() { Map<TokenEntry, Object> markGroups = new HashMap<TokenEntry, Object>(tokens.size()); for (int i = code.size() - 1; i >= 0; i--) { diff --git a/sonar-duplications/src/main/java/org/sonar/duplications/detector/suffixtree/Search.java b/sonar-duplications/src/main/java/org/sonar/duplications/detector/suffixtree/Search.java index 73fd6d596ca..650f9864dd5 100644 --- a/sonar-duplications/src/main/java/org/sonar/duplications/detector/suffixtree/Search.java +++ b/sonar-duplications/src/main/java/org/sonar/duplications/detector/suffixtree/Search.java @@ -19,10 +19,10 @@ */ package org.sonar.duplications.detector.suffixtree; -import java.util.*; - import com.google.common.collect.Lists; +import java.util.*; + public final class Search { private final SuffixTree tree; @@ -132,7 +132,7 @@ public final class Search { reporter.endOfGroup(); } - public static abstract class Collector { + public abstract static class Collector { /** * Invoked at the beginning of processing for current node. @@ -141,7 +141,7 @@ public final class Search { * thus we guaranty that length will not increase between two sequential calls of this method * (can be equal or less than previous value). * </p> - * + * * @param size number of parts in group * @param length length of each part in group */ @@ -149,7 +149,7 @@ public final class Search { /** * Invoked as many times as leafs in the subtree, where current node is root. - * + * * @param start start position in generalised text * @param end end position in generalised text */ |