Skip to content

Commit

Permalink
Fix quality flaws
Browse files Browse the repository at this point in the history
  • Loading branch information
benzonico committed Feb 19, 2016
1 parent 37c9185 commit 2294b19
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ private static boolean hasDeprecatedAnnotation(Iterable<AnnotationTree> annotati
protected static Tree getReportTree(Tree tree) {
Tree reportTree = tree;
if(reportTree.is(PublicApiChecker.classKinds())) {
reportTree = ExpressionsHelper.reportOnClassTree(((ClassTree) reportTree));
reportTree = ExpressionsHelper.reportOnClassTree((ClassTree) reportTree);
} else if(reportTree.is(PublicApiChecker.methodKinds())) {
reportTree = ((MethodTree) reportTree).simpleName();
} else if(reportTree.is(Tree.Kind.VARIABLE)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import org.sonar.check.Priority;
import org.sonar.check.Rule;
import org.sonar.check.RuleProperty;
import org.sonar.java.model.JavaTree;
import org.sonar.java.syntaxtoken.FirstSyntaxTokenFinder;
import org.sonar.java.syntaxtoken.LastSyntaxTokenFinder;
import org.sonar.java.tag.Tag;
Expand Down Expand Up @@ -199,7 +200,7 @@ private void checkIndentation(List<? extends Tree> trees) {
private void checkIndentation(Tree tree, int expectedLevel) {
SyntaxToken firstSyntaxToken = FirstSyntaxTokenFinder.firstSyntaxToken(tree);
if (firstSyntaxToken.column() != expectedLevel && !isExcluded(tree, firstSyntaxToken.line())) {
addIssue(tree, "Make this line start at column " + (expectedLevel + 1) + ".");
addIssue(((JavaTree) tree).getLine(), "Make this line start at column " + (expectedLevel + 1) + ".");
isBlockAlreadyReported = true;
}
lastCheckedLine = LastSyntaxTokenFinder.lastSyntaxToken(tree).line();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,3 +192,10 @@ protected void append(final ILoggingEvent event) {
}

}

public interface plop {
@Foo
public static class Inner { // Noncompliant
public static final String FOO = "foo";
}
}

0 comments on commit 2294b19

Please sign in to comment.