From 5b36bc4e9b72f4138c64d385c13ee22fcf6302d7 Mon Sep 17 00:00:00 2001 From: David DE CARVALHO Date: Tue, 19 Dec 2023 23:41:02 +0100 Subject: [PATCH] sonar issue correction --- .../java/checks/AvoidConcatenateStringsInLoop.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/fr/greencodeinitiative/java/checks/AvoidConcatenateStringsInLoop.java b/src/main/java/fr/greencodeinitiative/java/checks/AvoidConcatenateStringsInLoop.java index 491f412..488ebd0 100644 --- a/src/main/java/fr/greencodeinitiative/java/checks/AvoidConcatenateStringsInLoop.java +++ b/src/main/java/fr/greencodeinitiative/java/checks/AvoidConcatenateStringsInLoop.java @@ -41,7 +41,7 @@ public class AvoidConcatenateStringsInLoop extends IssuableSubscriptionVisitor { public static final String MESSAGE_RULE = "Don't concatenate Strings in loop, use StringBuilder instead."; private static final String STRING_CLASS = String.class.getName(); - private final StringConcatenationVisitor VISITOR = new StringConcatenationVisitor(); + private final StringConcatenationVisitor visitor = new StringConcatenationVisitor(); @Override public List nodesToVisit() { @@ -54,7 +54,7 @@ public List nodesToVisit() { @Override public void visitNode(@Nonnull Tree tree) { - tree.accept(VISITOR); + tree.accept(visitor); } private class StringConcatenationVisitor extends BaseTreeVisitor { @@ -75,10 +75,10 @@ public void visitAssignmentExpression(AssignmentExpressionTree tree) { super.visitAssignmentExpression(tree); } } - } - private boolean isStringType(ExpressionTree expressionTree) { - return expressionTree.symbolType().is(STRING_CLASS); + private boolean isStringType(ExpressionTree expressionTree) { + return expressionTree.symbolType().is(STRING_CLASS); + } } }