]> source.dussan.org Git - sonarqube.git/commitdiff
Fixed several violations
authorJean-Baptiste Vilain <jean-baptiste.vilain@sonarsource.com>
Thu, 23 May 2013 20:51:13 +0000 (22:51 +0200)
committerJean-Baptiste Vilain <jean-baptiste.vilain@sonarsource.com>
Thu, 23 May 2013 20:51:13 +0000 (22:51 +0200)
sonar-batch/src/main/java/org/sonar/batch/source/DefaultSymbolTable.java
sonar-core/src/main/java/org/sonar/core/source/HtmlTextDecorator.java
sonar-plugin-api/src/main/java/org/sonar/api/source/Symbol.java

index 3813f71ae8ef3289fd977360e5b49a7c754977d2..c4f78b7450259353489c05bf1323ab66895ec637 100644 (file)
@@ -37,6 +37,10 @@ public class DefaultSymbolTable implements Symbolizable.SymbolTable {
     this.referencesBySymbol = referencesBySymbol;
   }
 
+  public static Builder builder() {
+    return new Builder();
+  }
+
   public Multimap<Symbol, Integer> getReferencesBySymbol() {
     return referencesBySymbol;
   }
@@ -79,14 +83,14 @@ public class DefaultSymbolTable implements Symbolizable.SymbolTable {
       return new DefaultSymbolTable(referencesBySymbol);
     }
 
-    private class SymbolComparator implements Comparator<Symbol> {
+    private static class SymbolComparator implements Comparator<Symbol> {
       @Override
       public int compare(Symbol left, Symbol right) {
         return left.getDeclarationStartOffset() - right.getDeclarationStartOffset();
       }
     }
 
-    private class ReferenceComparator implements Comparator<Integer> {
+    private static class ReferenceComparator implements Comparator<Integer> {
       @Override
       public int compare(Integer left, Integer right) {
         int result;
index a6f156658b93eb2b877776555b273e8e6bb485bd..b8ba888c88ab61615fbcbeeaf3eade09bfc02f1c 100644 (file)
@@ -145,8 +145,7 @@ class HtmlTextDecorator {
   private boolean shouldReopenPendingTags(CharactersReader charactersReader) {
     return (charactersReader.getPreviousValue() == LF_END_OF_LINE && charactersReader.getCurrentValue() != LF_END_OF_LINE)
       || (charactersReader.getPreviousValue() == CR_END_OF_LINE && charactersReader.getCurrentValue() != CR_END_OF_LINE
-      && charactersReader.getCurrentValue() != LF_END_OF_LINE
-    );
+      && charactersReader.getCurrentValue() != LF_END_OF_LINE);
   }
 
   private boolean shouldStartNewLine(CharactersReader charactersReader) {
index 2b7df78db9741e4e339850a246dd8cb53a86751a..d808c7a81abe655d7b47f45e33643159f6f02113 100644 (file)
@@ -22,9 +22,9 @@ package org.sonar.api.source;
 
 public interface Symbol {
 
-  public int getDeclarationStartOffset();
+  int getDeclarationStartOffset();
 
-  public int getDeclarationEndOffset();
+  int getDeclarationEndOffset();
 
-  public String getFullyQualifiedName();
+  String getFullyQualifiedName();
 }