summaryrefslogtreecommitdiffstats
path: root/sonar-colorizer
diff options
context:
space:
mode:
authorZeeshan Asghar <zeeshan.asghar@devfactory.com>2016-01-21 15:56:32 +0500
committerTeryk Bellahsene <teryk.bellahsene@sonarsource.com>2016-01-29 17:01:31 +0100
commitbf071cefa1d04303ae246de745a8856c64b9617f (patch)
tree8d31b74cadac3271f8519d3d76566f04b2139e45 /sonar-colorizer
parent1fc88e490a8db848301e784d53d5170018b6d1e5 (diff)
downloadsonarqube-bf071cefa1d04303ae246de745a8856c64b9617f.tar.gz
sonarqube-bf071cefa1d04303ae246de745a8856c64b9617f.zip
squid:S1213 members of an interface decleration or class should appear in a pre-defined order
Diffstat (limited to 'sonar-colorizer')
-rw-r--r--sonar-colorizer/src/main/java/org/sonar/colorizer/InlineDocTokenizer.java13
-rw-r--r--sonar-colorizer/src/main/java/org/sonar/colorizer/JavaAnnotationTokenizer.java11
-rw-r--r--sonar-colorizer/src/main/java/org/sonar/colorizer/JavaConstantTokenizer.java15
3 files changed, 18 insertions, 21 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 c361022b512..b19fe9fc826 100644
--- a/sonar-colorizer/src/main/java/org/sonar/colorizer/InlineDocTokenizer.java
+++ b/sonar-colorizer/src/main/java/org/sonar/colorizer/InlineDocTokenizer.java
@@ -34,6 +34,12 @@ public abstract class InlineDocTokenizer extends Tokenizer {
private final String tagAfter;
private final char[] startToken;
+ private static final EndMatcher LINE_END_MATCHER = new EndMatcher() {
+ @Override
+ public boolean match(int endFlag) {
+ return endFlag == '\r' || endFlag == '\n';
+ }
+ };
public InlineDocTokenizer(String startToken, String tagBefore, String tagAfter) {
this.tagBefore = tagBefore;
@@ -53,11 +59,4 @@ public abstract class InlineDocTokenizer extends Tokenizer {
}
}
- private static final EndMatcher LINE_END_MATCHER = new EndMatcher() {
- @Override
- public boolean match(int endFlag) {
- return endFlag == '\r' || endFlag == '\n';
- }
- };
-
}
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 e273190acb7..3647b1fb1ce 100644
--- a/sonar-colorizer/src/main/java/org/sonar/colorizer/JavaAnnotationTokenizer.java
+++ b/sonar-colorizer/src/main/java/org/sonar/colorizer/JavaAnnotationTokenizer.java
@@ -30,12 +30,6 @@ public class JavaAnnotationTokenizer extends Tokenizer {
private final String tagBefore;
private final String tagAfter;
-
- public JavaAnnotationTokenizer(String tagBefore, String tagAfter) {
- this.tagBefore = tagBefore;
- this.tagAfter = tagAfter;
- }
-
private static final EndMatcher END_TOKEN_MATCHER = new EndMatcher() {
@Override
public boolean match(int endFlag) {
@@ -43,6 +37,11 @@ public class JavaAnnotationTokenizer extends Tokenizer {
}
};
+ public JavaAnnotationTokenizer(String tagBefore, String tagAfter) {
+ this.tagBefore = tagBefore;
+ this.tagAfter = tagAfter;
+ }
+
@Override
public boolean consume(CodeReader code, HtmlCodeBuilder codeBuilder) {
if (code.peek() == '@') {
diff --git a/sonar-colorizer/src/main/java/org/sonar/colorizer/JavaConstantTokenizer.java b/sonar-colorizer/src/main/java/org/sonar/colorizer/JavaConstantTokenizer.java
index 988cb571f4b..cb10364604b 100644
--- a/sonar-colorizer/src/main/java/org/sonar/colorizer/JavaConstantTokenizer.java
+++ b/sonar-colorizer/src/main/java/org/sonar/colorizer/JavaConstantTokenizer.java
@@ -31,6 +31,13 @@ public class JavaConstantTokenizer extends Tokenizer {
private final String tagBefore;
private final String tagAfter;
private static final int DOT = '.';
+ private EndMatcher endTokenMatcher = new EndMatcher() {
+
+ @Override
+ public boolean match(int endFlag) {
+ return !isJavaConstantPart(endFlag);
+ }
+ };
public JavaConstantTokenizer(String tagBefore, String tagAfter) {
this.tagBefore = tagBefore;
@@ -71,12 +78,4 @@ public class JavaConstantTokenizer extends Tokenizer {
return Character.isUpperCase(character) || character == '_' || character == '-' || Character.isDigit(character);
}
- private EndMatcher endTokenMatcher = new EndMatcher() {
-
- @Override
- public boolean match(int endFlag) {
- return !isJavaConstantPart(endFlag);
- }
- };
-
}