aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-colorizer/src/main
diff options
context:
space:
mode:
authorEvgeny Mandrikov <mandrikov@gmail.com>2011-11-03 12:32:03 +0400
committerEvgeny Mandrikov <mandrikov@gmail.com>2011-11-03 13:10:43 +0400
commitcab01ac39897c39b0b669c04823da607c376c93e (patch)
tree0207f03193f8f3dc8fa9f0ef9cc44d227ebee3e2 /sonar-colorizer/src/main
parentd234f0fbdb75112af3f39a9b4fb85ac9fe0552ed (diff)
downloadsonarqube-cab01ac39897c39b0b669c04823da607c376c93e.tar.gz
sonarqube-cab01ac39897c39b0b669c04823da607c376c93e.zip
Fix violations
Diffstat (limited to 'sonar-colorizer/src/main')
-rw-r--r--sonar-colorizer/src/main/java/org/sonar/colorizer/JavaAnnotationTokenizer.java5
-rw-r--r--sonar-colorizer/src/main/java/org/sonar/colorizer/KeywordsTokenizer.java6
2 files changed, 5 insertions, 6 deletions
diff --git a/sonar-colorizer/src/main/java/org/sonar/colorizer/JavaAnnotationTokenizer.java b/sonar-colorizer/src/main/java/org/sonar/colorizer/JavaAnnotationTokenizer.java
index 554e0613fac..1a5489e75f5 100644
--- a/sonar-colorizer/src/main/java/org/sonar/colorizer/JavaAnnotationTokenizer.java
+++ b/sonar-colorizer/src/main/java/org/sonar/colorizer/JavaAnnotationTokenizer.java
@@ -32,8 +32,7 @@ public class JavaAnnotationTokenizer extends Tokenizer {
this.tagAfter = tagAfter;
}
- private static final EndMatcher endTokenMatcher = new EndMatcher() {
-
+ private static final EndMatcher END_TOKEN_MATCHER = new EndMatcher() {
public boolean match(int endFlag) {
return !Character.isJavaIdentifierPart(endFlag);
}
@@ -43,7 +42,7 @@ public class JavaAnnotationTokenizer extends Tokenizer {
public boolean consume(CodeReader code, HtmlCodeBuilder codeBuilder) {
if (code.peek() == '@') {
codeBuilder.appendWithoutTransforming(tagBefore);
- code.popTo(endTokenMatcher, codeBuilder);
+ code.popTo(END_TOKEN_MATCHER, codeBuilder);
codeBuilder.appendWithoutTransforming(tagAfter);
return true;
} else {
diff --git a/sonar-colorizer/src/main/java/org/sonar/colorizer/KeywordsTokenizer.java b/sonar-colorizer/src/main/java/org/sonar/colorizer/KeywordsTokenizer.java
index 3152b41161f..9bf9225461c 100644
--- a/sonar-colorizer/src/main/java/org/sonar/colorizer/KeywordsTokenizer.java
+++ b/sonar-colorizer/src/main/java/org/sonar/colorizer/KeywordsTokenizer.java
@@ -37,12 +37,12 @@ public class KeywordsTokenizer extends NotThreadSafeTokenizer {
private boolean caseInsensitive = false;
private Matcher matcher;
private final StringBuilder tmpBuilder = new StringBuilder();
- private final static String defaultRegex = "[a-zA-Z_][a-zA-Z0-9_]*+";
+ private final static String DEFAULT_REGEX = "[a-zA-Z_][a-zA-Z0-9_]*+";
private Set<String> keywords = new HashSet<String>();
public KeywordsTokenizer(String tagBefore, String tagAfter, Set<String> keywords) {
- this(tagBefore, tagAfter, keywords, defaultRegex);
+ this(tagBefore, tagAfter, keywords, DEFAULT_REGEX);
}
public KeywordsTokenizer(String tagBefore, String tagAfter, Set<String> keywords, String regex) {
@@ -56,7 +56,7 @@ public class KeywordsTokenizer extends NotThreadSafeTokenizer {
this.tagBefore = tagBefore;
this.tagAfter = tagAfter;
Collections.addAll(this.keywords, keywords);
- this.matcher = Pattern.compile(defaultRegex).matcher("");
+ this.matcher = Pattern.compile(DEFAULT_REGEX).matcher("");
}
public boolean consume(CodeReader code, HtmlCodeBuilder codeBuilder) {