Permalink
Browse files

fix: squid:S1488 - Local Variables should not be declared and then im…

…mediately returned or thrown

closes #513
  • Loading branch information...
George Kankava authored and vlsi committed Feb 17, 2016
1 parent 7aac95c commit 299c9f592580dc00d115a7f9744d7214b5d92f74
@@ -100,9 +100,7 @@ public Object fastpath(int fnId, boolean resultType, FastpathArg[] args) throws
}

// Run it.
byte[] returnValue = executor.fastpathCall(fnId, params, connection.getAutoCommit());

return returnValue;
return executor.fastpathCall(fnId, params, connection.getAutoCommit());
}

/**
@@ -167,8 +165,7 @@ public int getInteger(String name, FastpathArg[] args) throws SQLException {
}

if (returnValue.length == 4) {
int i = ByteConverter.int4(returnValue, 0);
return i;
return ByteConverter.int4(returnValue, 0);
} else {
throw new PSQLException(GT.tr(
"Fastpath call {0} - No result was returned or wrong size while expecting an integer.",
@@ -192,8 +189,7 @@ public long getLong(String name, FastpathArg[] args) throws SQLException {
PSQLState.NO_DATA);
}
if (returnValue.length == 8) {
long l = ByteConverter.int8(returnValue, 0);
return l;
return ByteConverter.int8(returnValue, 0);

} else {
throw new PSQLException(
@@ -3103,9 +3103,7 @@ public boolean supportsBatchUpdates() throws SQLException {
}
sql += toAdd;
sql += " order by data_type, type_schem, type_name";
java.sql.ResultSet rs = createMetaDataStatement().executeQuery(sql);

return rs;
return createMetaDataStatement().executeQuery(sql);
}


@@ -85,8 +85,7 @@ private void configureBaseDataSource(BaseDataSource ds, Properties props) throws
throw new PSQLException(GT.tr("Unsupported properties: {0}", props.stringPropertyNames()),
PSQLState.INVALID_PARAMETER_VALUE);
}
org.postgresql.Driver driver = new org.postgresql.Driver();
return driver;
return new org.postgresql.Driver();
}

private DataSource createPoolingDataSource(Properties props) throws SQLException {

0 comments on commit 299c9f5

Please sign in to comment.