Skip to content

Commit 625a25f

Browse files
committed
Fix issues reported by sonarlint
1 parent 9401da7 commit 625a25f

File tree

4 files changed

+14
-15
lines changed

4 files changed

+14
-15
lines changed

src/main/java/io/github/utplsql/api/DBHelper.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
*/
1313
public final class DBHelper {
1414

15+
private DBHelper() {}
16+
1517
/**
1618
* Return a new sys_guid from database.
1719
* @param conn the connection

src/main/java/io/github/utplsql/api/OutputBuffer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public void fetchAvailable(Connection conn, Callback cb) throws SQLException {
6666
PreparedStatement preparedStatement = null;
6767
ResultSet resultSet = null;
6868
try {
69-
preparedStatement = conn.prepareCall("SELECT * FROM table(ut_output_buffer.get_lines(?))");
69+
preparedStatement = conn.prepareStatement("SELECT * FROM table(ut_output_buffer.get_lines(?))");
7070
preparedStatement.setString(1, getReporter().getReporterId());
7171
resultSet = preparedStatement.executeQuery();
7272

src/main/java/io/github/utplsql/api/TestRunner.java

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@ public class TestRunner {
2121
private List<String> includeObjects = new ArrayList<>();
2222
private List<String> excludeObjects = new ArrayList<>();
2323

24-
public TestRunner() {
25-
}
26-
2724
public TestRunner addPath(String path) {
2825
this.pathList.add(path);
2926
return this;
@@ -84,11 +81,11 @@ public void run(Connection conn) throws SQLException {
8481
OracleConnection oraConn = conn.unwrap(OracleConnection.class);
8582
Array pathArray = oraConn.createARRAY(CustomTypes.UT_VARCHAR2_LIST, this.pathList.toArray());
8683
Array reporterArray = oraConn.createARRAY(CustomTypes.UT_REPORTERS, this.reporterList.toArray());
87-
Array coverageSchemes = oraConn.createARRAY(CustomTypes.UT_VARCHAR2_LIST, this.coverageSchemes.toArray());
88-
Array sourceFiles = oraConn.createARRAY(CustomTypes.UT_VARCHAR2_LIST, this.sourceFiles.toArray());
89-
Array testFiles = oraConn.createARRAY(CustomTypes.UT_VARCHAR2_LIST, this.testFiles.toArray());
90-
Array includeObjects = oraConn.createARRAY(CustomTypes.UT_VARCHAR2_LIST, this.includeObjects.toArray());
91-
Array excludeObjects = oraConn.createARRAY(CustomTypes.UT_VARCHAR2_LIST, this.excludeObjects.toArray());
84+
Array coverageSchemesArray = oraConn.createARRAY(CustomTypes.UT_VARCHAR2_LIST, this.coverageSchemes.toArray());
85+
Array sourceFilesArray = oraConn.createARRAY(CustomTypes.UT_VARCHAR2_LIST, this.sourceFiles.toArray());
86+
Array testFilesArray = oraConn.createARRAY(CustomTypes.UT_VARCHAR2_LIST, this.testFiles.toArray());
87+
Array includeObjectsArray = oraConn.createARRAY(CustomTypes.UT_VARCHAR2_LIST, this.includeObjects.toArray());
88+
Array excludeObjectsArray = oraConn.createARRAY(CustomTypes.UT_VARCHAR2_LIST, this.excludeObjects.toArray());
9289

9390
CallableStatement callableStatement = null;
9491
try {
@@ -101,11 +98,11 @@ public void run(Connection conn) throws SQLException {
10198
"END;");
10299
callableStatement.setArray(1, pathArray);
103100
callableStatement.setArray(2, reporterArray);
104-
callableStatement.setArray(3, coverageSchemes);
105-
callableStatement.setArray(4, sourceFiles);
106-
callableStatement.setArray(5, testFiles);
107-
callableStatement.setArray(6, includeObjects);
108-
callableStatement.setArray(7, excludeObjects);
101+
callableStatement.setArray(3, coverageSchemesArray);
102+
callableStatement.setArray(4, sourceFilesArray);
103+
callableStatement.setArray(5, testFilesArray);
104+
callableStatement.setArray(6, includeObjectsArray);
105+
callableStatement.setArray(7, excludeObjectsArray);
109106
callableStatement.execute();
110107
} finally {
111108
if (callableStatement != null)

src/main/java/io/github/utplsql/api/reporter/ReporterFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ public static Reporter createReporter(String reporterName) {
1515
case CustomTypes.UT_COVERALLS_REPORTER: return new CoverallsReporter();
1616
case CustomTypes.UT_COVERAGE_SONAR_REPORTER: return new CoverageSonarReporter();
1717
case CustomTypes.UT_SONAR_TEST_REPORTER: return new SonarTestReporter();
18+
default: throw new RuntimeException("Reporter " + reporterName + " not implemented.");
1819
}
19-
throw new RuntimeException("Reporter " + reporterName + " not implemented.");
2020
}
2121

2222
}

0 commit comments

Comments
 (0)