Skip to content

Commit

Permalink
Add duplication code
Browse files Browse the repository at this point in the history
  • Loading branch information
antoine-vinot-sonarsource committed Oct 17, 2023
1 parent 8b40517 commit edf2d50
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/main/java/test/Pikachu.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
package test;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.Collection;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.springframework.util.DigestUtils;

public class Pikachu extends Pokemon {

Expand Down Expand Up @@ -39,6 +43,14 @@ private static PreparedStatement createStatement(String projectUuid, Collection<
return res;
}

public void myVulnerability() {
try {
DriverManager.getConnection("jdbc:derby:memory:myDB;create=true", "login", "");
} catch (SQLException e) {
throw new RuntimeException(e);
}
}

private static PreparedStatement createStatement2(String projectUuid, Collection<String> dispatcherKeys, Connection connection) throws SQLException {
String sql =
"SELECT count(1) FROM properties pp " +
Expand All @@ -62,4 +74,13 @@ private static PreparedStatement createStatement2(String projectUuid, Collection
}
return res;
}

public void myVulnerability2() {
try {
DriverManager.getConnection("jdbc:derby:memory:myDB;create=true", "login", "");
} catch (SQLException e) {
throw new RuntimeException(e);
}
}

}

0 comments on commit edf2d50

Please sign in to comment.