Skip to content

Commit 99f38fb

Browse files
committed
address inspection warnings
1 parent 724ddcd commit 99f38fb

File tree

8 files changed

+12
-15
lines changed

8 files changed

+12
-15
lines changed

src/main/java/org/utplsql/api/JavaApiVersionInfo.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@
44
import java.io.IOException;
55
import java.io.InputStream;
66
import java.io.InputStreamReader;
7-
import java.net.URISyntaxException;
8-
import java.nio.charset.Charset;
9-
import java.nio.file.Files;
10-
import java.nio.file.Paths;
117

128
/** This class is getting updated automatically by the build process.
139
* Please do not update its constants manually cause they will be overwritten.
@@ -25,11 +21,9 @@ private JavaApiVersionInfo() { }
2521
static {
2622
try {
2723

28-
try ( InputStream in = JavaApiVersionInfo.class.getClassLoader().getResourceAsStream("utplsql-api.version")) {
29-
BufferedReader reader = new BufferedReader(new InputStreamReader(in));
24+
try ( InputStream in = JavaApiVersionInfo.class.getClassLoader().getResourceAsStream("utplsql-api.version");
25+
BufferedReader reader = new BufferedReader(new InputStreamReader(in))) {
3026
MAVEN_PROJECT_VERSION = reader.readLine();
31-
32-
reader.close();
3327
}
3428
}
3529
catch ( IOException e ) {

src/main/java/org/utplsql/api/TestRunner.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import org.utplsql.api.compatibility.CompatibilityProxy;
66
import org.utplsql.api.db.DatabaseInformation;
77
import org.utplsql.api.db.DefaultDatabaseInformation;
8-
import org.utplsql.api.exception.DatabaseNotCompatibleException;
98
import org.utplsql.api.exception.SomeTestsFailedException;
109
import org.utplsql.api.exception.UtPLSQLNotInstalledException;
1110
import org.utplsql.api.reporter.DocumentationReporter;

src/main/java/org/utplsql/api/Version.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public class Version implements Comparable<Version> {
3737
private final Integer build;
3838
private final boolean valid;
3939

40-
private Version(String origString, Integer major, Integer minor, Integer bugfix, Integer build, boolean valid) {
40+
private Version(String origString, @Nullable Integer major, @Nullable Integer minor, @Nullable Integer bugfix, @Nullable Integer build, boolean valid) {
4141
this.origString = origString;
4242
this.major = major;
4343
this.minor = minor;
@@ -109,18 +109,22 @@ public String toString() {
109109
return origString;
110110
}
111111

112+
@Nullable
112113
public Integer getMajor() {
113114
return major;
114115
}
115116

117+
@Nullable
116118
public Integer getMinor() {
117119
return minor;
118120
}
119121

122+
@Nullable
120123
public Integer getBugfix() {
121124
return bugfix;
122125
}
123126

127+
@Nullable
124128
public Integer getBuild() {
125129
return build;
126130
}

src/main/java/org/utplsql/api/compatibility/CompatibilityProxy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public class CompatibilityProxy {
2828

2929
private Version databaseVersion;
3030
private boolean compatible = false;
31-
private DatabaseInformation databaseInformation;
31+
private final DatabaseInformation databaseInformation;
3232

3333
public CompatibilityProxy( Connection conn ) throws SQLException {
3434
this(conn, false, null);

src/main/java/org/utplsql/api/exception/DatabaseNotCompatibleException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public DatabaseNotCompatibleException( String message, Version clientVersion, Ve
2525

2626
public DatabaseNotCompatibleException( Version clientVersion, Version databaseVersion, Throwable cause )
2727
{
28-
this("utPLSQL API (" + String.valueOf(clientVersion) + ") not compatible with database (" + String.valueOf(databaseVersion) + ")", clientVersion, databaseVersion, cause);
28+
this("utPLSQL API (" + clientVersion + ") not compatible with database (" + databaseVersion + ")", clientVersion, databaseVersion, cause);
2929
}
3030

3131
public DatabaseNotCompatibleException( Version clientVersion, Version databaseVersion )

src/main/java/org/utplsql/api/testRunner/AbstractTestRunnerStatement.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
abstract class AbstractTestRunnerStatement implements TestRunnerStatement {
2222

2323
protected final TestRunnerOptions options;
24-
protected final Connection conn;
24+
private final Connection conn;
2525
protected final CallableStatement callableStatement;
2626

2727
public AbstractTestRunnerStatement(TestRunnerOptions options, Connection conn) throws SQLException {

src/test/java/org/utplsql/api/JavaApiVersionTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import static org.junit.jupiter.api.Assertions.assertTrue;
66

7-
public class JavaApiVersionTest {
7+
class JavaApiVersionTest {
88

99
@Test
1010
void getJavaApiVersion() {

src/test/java/org/utplsql/api/OutputBufferIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
*/
2828
class OutputBufferIT extends AbstractDatabaseTest {
2929

30-
public Reporter createReporter() throws SQLException {
30+
private Reporter createReporter() throws SQLException {
3131
Reporter reporter = new DocumentationReporter().init(newConnection());
3232
System.out.println("Reporter ID: " + reporter.getId());
3333
return reporter;

0 commit comments

Comments
 (0)