aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-colorizer
diff options
context:
space:
mode:
Diffstat (limited to 'sonar-colorizer')
-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) {