Skip to content

Commit

Permalink
sonar issue correction - BIS
Browse files Browse the repository at this point in the history
  • Loading branch information
David DE CARVALHO committed Dec 19, 2023
1 parent 5b36bc4 commit 36351eb
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class AvoidSQLRequestInLoop extends IssuableSubscriptionVisitor {
private static final String JAVA_SQL_CONNECTION = "java.sql.Connection";
private static final String SPRING_JDBC_OPERATIONS = "org.springframework.jdbc.core.JdbcOperations";

private final MethodMatchers SQL_METHOD = MethodMatchers.or(
private static final MethodMatchers SQL_METHOD = MethodMatchers.or(
MethodMatchers.create().ofSubTypes("org.hibernate.Session").names("createQuery", "createSQLQuery")
.withAnyParameters().build(),
MethodMatchers.create().ofSubTypes(JAVA_SQL_STATEMENT)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class AvoidStatementForDMLQueries extends IssuableSubscriptionVisitor {

private static final Pattern PATTERN = Pattern.compile("(SELECT|INSERT INTO|UPDATE|DELETE FROM)\\s?.*", Pattern.CASE_INSENSITIVE);

private final MethodMatchers EXECUTE_METHOD = MethodMatchers.or(
private static final MethodMatchers EXECUTE_METHOD = MethodMatchers.or(
MethodMatchers.create().ofSubTypes("java.sql.Statement").names("executeUpdate")
.withAnyParameters().build());

Expand All @@ -54,7 +54,7 @@ public void visitNode(Tree tree) {
if (!EXECUTE_METHOD.matches(methodInvocationTree))
return;
Arguments arguments = methodInvocationTree.arguments();
if (arguments.size() < 1)
if (arguments.isEmpty())
return;
ExpressionTree first = arguments.get(0);
if (first.is(Tree.Kind.STRING_LITERAL)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import org.sonar.java.checks.verifier.CheckVerifier;

@Deprecated
public class AvoidConcatenateStringsInLoopTest {
class AvoidConcatenateStringsInLoopTest {

@Test
void checkNonCompliantTests() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import org.junit.jupiter.api.Test;
import org.sonar.java.checks.verifier.CheckVerifier;

public class AvoidRegexPatternNotStaticTest {
class AvoidRegexPatternNotStaticTest {

@Test
void testHasIssues() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import org.junit.jupiter.api.Test;
import org.sonar.java.checks.verifier.CheckVerifier;

public class AvoidStatementForDMLQueriesTest {
class AvoidStatementForDMLQueriesTest {
@Test
void test() {
CheckVerifier.newVerifier()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import org.junit.jupiter.api.Test;
import org.sonar.java.checks.verifier.CheckVerifier;

public class AvoidUsageOfStaticCollectionsTests {
class AvoidUsageOfStaticCollectionsTests {

@Test
void testHasIssues() {
Expand Down

0 comments on commit 36351eb

Please sign in to comment.