From: Jean-Baptiste Vilain Date: Thu, 23 May 2013 20:51:13 +0000 (+0200) Subject: Fixed several violations X-Git-Tag: 3.6~283 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=28c139001df446e5a30e850c8c7efe01d2103436;p=sonarqube.git Fixed several violations --- diff --git a/sonar-batch/src/main/java/org/sonar/batch/source/DefaultSymbolTable.java b/sonar-batch/src/main/java/org/sonar/batch/source/DefaultSymbolTable.java index 3813f71ae8e..c4f78b74502 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/source/DefaultSymbolTable.java +++ b/sonar-batch/src/main/java/org/sonar/batch/source/DefaultSymbolTable.java @@ -37,6 +37,10 @@ public class DefaultSymbolTable implements Symbolizable.SymbolTable { this.referencesBySymbol = referencesBySymbol; } + public static Builder builder() { + return new Builder(); + } + public Multimap getReferencesBySymbol() { return referencesBySymbol; } @@ -79,14 +83,14 @@ public class DefaultSymbolTable implements Symbolizable.SymbolTable { return new DefaultSymbolTable(referencesBySymbol); } - private class SymbolComparator implements Comparator { + private static class SymbolComparator implements Comparator { @Override public int compare(Symbol left, Symbol right) { return left.getDeclarationStartOffset() - right.getDeclarationStartOffset(); } } - private class ReferenceComparator implements Comparator { + private static class ReferenceComparator implements Comparator { @Override public int compare(Integer left, Integer right) { int result; diff --git a/sonar-core/src/main/java/org/sonar/core/source/HtmlTextDecorator.java b/sonar-core/src/main/java/org/sonar/core/source/HtmlTextDecorator.java index a6f156658b9..b8ba888c88a 100644 --- a/sonar-core/src/main/java/org/sonar/core/source/HtmlTextDecorator.java +++ b/sonar-core/src/main/java/org/sonar/core/source/HtmlTextDecorator.java @@ -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) { diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/source/Symbol.java b/sonar-plugin-api/src/main/java/org/sonar/api/source/Symbol.java index 2b7df78db97..d808c7a81ab 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/source/Symbol.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/source/Symbol.java @@ -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(); }