aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-colorizer/src
diff options
context:
space:
mode:
authorEvgeny Mandrikov <mandrikov@gmail.com>2011-05-29 01:24:07 +0400
committerEvgeny Mandrikov <mandrikov@gmail.com>2011-05-29 03:09:39 +0400
commita44965f6bdee2dcb6b96b7a0cae1ef2a1f8604c9 (patch)
tree4453364397808b7caad6842e56e63a9c4d9fb0df /sonar-colorizer/src
parent42e6f9118e856f010e4c3bd301f7435ec71d5399 (diff)
downloadsonarqube-a44965f6bdee2dcb6b96b7a0cae1ef2a1f8604c9.tar.gz
sonarqube-a44965f6bdee2dcb6b96b7a0cae1ef2a1f8604c9.zip
Fix violations
Diffstat (limited to 'sonar-colorizer/src')
-rw-r--r--sonar-colorizer/src/main/java/org/sonar/colorizer/InlineDocTokenizer.java17
1 files changed, 9 insertions, 8 deletions
diff --git a/sonar-colorizer/src/main/java/org/sonar/colorizer/InlineDocTokenizer.java b/sonar-colorizer/src/main/java/org/sonar/colorizer/InlineDocTokenizer.java
index 0d6d70fa481..76f1025d712 100644
--- a/sonar-colorizer/src/main/java/org/sonar/colorizer/InlineDocTokenizer.java
+++ b/sonar-colorizer/src/main/java/org/sonar/colorizer/InlineDocTokenizer.java
@@ -19,11 +19,11 @@
*/
package org.sonar.colorizer;
-import java.util.Arrays;
-
import org.sonar.channel.CodeReader;
import org.sonar.channel.EndMatcher;
+import java.util.Arrays;
+
public abstract class InlineDocTokenizer extends Tokenizer {
private final String tagBefore;
@@ -40,12 +40,7 @@ public abstract class InlineDocTokenizer extends Tokenizer {
public boolean consume(CodeReader code, HtmlCodeBuilder codeBuilder) {
if (code.peek() == startToken[0] && Arrays.equals(code.peek(startToken.length), startToken)) {
codeBuilder.appendWithoutTransforming(tagBefore);
- code.popTo(new EndMatcher() {
-
- public boolean match(int endFlag) {
- return endFlag == '\r' || endFlag == '\n';
- }
- }, codeBuilder);
+ code.popTo(LINE_END_MATCHER, codeBuilder);
codeBuilder.appendWithoutTransforming(tagAfter);
return true;
} else {
@@ -53,4 +48,10 @@ public abstract class InlineDocTokenizer extends Tokenizer {
}
}
+ private static final EndMatcher LINE_END_MATCHER = new EndMatcher() {
+ public boolean match(int endFlag) {
+ return endFlag == '\r' || endFlag == '\n';
+ }
+ };
+
}