Permalink
Browse files

Findbugs fixes

  • Loading branch information...
nvoxland committed Aug 16, 2016
1 parent 404963b commit d4b6e0269275be9c0db0d922c83ecb3fad9c9ea9
View
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<FindBugsFilter>
<LastVersion value="-1" relOp="NEQ"/>
<And>
<Rank value="10"/>
<Bug category="SECURITY"/>
<Bug code="SQL"/>
<Bug pattern="SQL_NONCONSTANT_STRING_PASSED_TO_EXECUTE"/>
</And>
<And>
<Rank value="12"/>
<Bug category="CORRECTNESS"/>
<Bug code="UwF"/>
<Bug pattern="UWF_UNWRITTEN_FIELD"/>
</And>
<And>
<Rank value="15"/>
<Bug category="STYLE"/>
<Bug code="DLS"/>
</And>
<And>
<Rank value="15"/>
<Bug category="STYLE"/>
<Bug code="ST"/>
<Bug pattern="ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD"/>
</And>
<And>
<Rank value="14"/>
<Bug category="BAD_PRACTICE"/>
<Bug code="Nm"/>
<Bug pattern="NM_SAME_SIMPLE_NAME_AS_SUPERCLASS"/>
</And>
</FindBugsFilter>
@@ -473,7 +473,8 @@ public boolean canAccessDbaRecycleBin() {
Statement statement = null;
try {
statement = ((JdbcConnection) connection).createStatement();
statement.executeQuery("select 1 from dba_recyclebin where 0=1");
ResultSet resultSet = statement.executeQuery("select 1 from dba_recyclebin where 0=1");
resultSet.close(); //don't need to do anything with the result set, just make sure statement ran.
this.canAccessDbaRecycleBin = true;
} catch (Exception e) {
if (e instanceof SQLException && e.getMessage().startsWith("ORA-00942")) { //ORA-00942: table or view does not exist
@@ -581,10 +581,10 @@ public Edge(Node from, Node to) {
@Override
public boolean equals(Object obj) {
if (!(obj instanceof Edge)) {
if (obj == null) {
return false;
}
if (obj == null) {
if (!(obj instanceof Edge)) {
return false;
}
Edge e = (Edge) obj;
@@ -72,15 +72,15 @@ public int getPriority(Class<? extends DatabaseObject> objectType, Database data
String fileName = table.getName().toLowerCase() + ".csv";
if (dataDir != null) {
fileName = dataDir + "/" + fileName;
}
File parentDir = new File(dataDir);
if (!parentDir.exists()) {
parentDir.mkdirs();
}
if (!parentDir.isDirectory()) {
throw new RuntimeException(parentDir
+ " is not a directory");
File parentDir = new File(dataDir);
if (!parentDir.exists()) {
parentDir.mkdirs();
}
if (!parentDir.isDirectory()) {
throw new RuntimeException(parentDir
+ " is not a directory");
}
}
CSVWriter outputFile = new CSVWriter(new BufferedWriter(new FileWriter(fileName)));
@@ -162,7 +162,7 @@ static boolean isSystemWindows() {
* @return true if it is a separator character
*/
private static boolean isSeparator(char ch) {
return (ch == UNIX_SEPARATOR) || (ch == WINDOWS_SEPARATOR);
return ch == '/'; //java uses this as a separator in both windows and unix
}
//-----------------------------------------------------------------------
View
@@ -1,14 +1,16 @@
<Project projectName="liquibase">
<Jar>.\liquibase-core\target\classes</Jar>
<Jar>.\liquibase-cdi\target\classes</Jar>
<Jar>.\liquibase-maven-plugin\target\classes</Jar>
<Jar>.\liquibase-osgi\target\classes</Jar>
<AuxClasspathEntry>.\liquibase-debian\target\lib</AuxClasspathEntry>
<SrcDir>.\liquibase-cdi\src\main\java</SrcDir>
<SrcDir>.\liquibase-core\src\main\java</SrcDir>
<SrcDir>.\liquibase-maven-plugin\src\main\java</SrcDir>
<SrcDir>.\liquibase-osgi\src\main\java</SrcDir>
<Jar>.\.\.\.\.\.\liquibase-core\target\classes</Jar>
<Jar>.\.\.\.\.\.\liquibase-cdi\target\classes</Jar>
<Jar>.\.\.\.\.\.\liquibase-maven-plugin\target\classes</Jar>
<Jar>.\.\.\.\.\.\liquibase-osgi\target\classes</Jar>
<AuxClasspathEntry>.\.\.\.\.\.\liquibase-debian\target\lib</AuxClasspathEntry>
<SrcDir>.\.\.\.\.\.\liquibase-cdi\src\main\java</SrcDir>
<SrcDir>.\.\.\.\.\.\liquibase-core\src\main\java</SrcDir>
<SrcDir>.\.\.\.\.\.\liquibase-maven-plugin\src\main\java</SrcDir>
<SrcDir>.\.\.\.\.\.\liquibase-osgi\src\main\java</SrcDir>
<SuppressionFilter>
<LastVersion value="-1" relOp="NEQ"/>
</SuppressionFilter>
<Plugin id="edu.umd.cs.findbugs.plugins.findbugsCommunalCloud" enabled="false"/>
<Plugin id="edu.umd.cs.findbugs.plugins.bugCollectionCloud" enabled="true"/>
</Project>

0 comments on commit d4b6e02

Please sign in to comment.