diff options
Diffstat (limited to 'sonar-colorizer/src')
-rw-r--r-- | sonar-colorizer/src/main/java/org/sonar/colorizer/InlineDocTokenizer.java | 17 |
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'; + } + }; + } |