mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-03-24 10:01:35 +01:00
Cleanup: Codacy conformance
This commit is contained in:
@@ -78,11 +78,10 @@ public final class CveDB {
|
|||||||
*/
|
*/
|
||||||
private final DatabaseProperties databaseProperties;
|
private final DatabaseProperties databaseProperties;
|
||||||
/**
|
/**
|
||||||
* Creates a new CveDB object and opens the database connection. Note, the
|
* Does the underlying connection support batch operations?
|
||||||
* connection must be closed by the caller by calling the close method.
|
* Currently we do not support batch execution.
|
||||||
* ======= Does the underlying connection support batch operations?
|
|
||||||
*/
|
*/
|
||||||
private final boolean batchSupported;
|
private final boolean batchSupported = false;
|
||||||
/**
|
/**
|
||||||
* The prepared statements.
|
* The prepared statements.
|
||||||
*/
|
*/
|
||||||
@@ -127,7 +126,6 @@ public final class CveDB {
|
|||||||
public CveDB() throws DatabaseException {
|
public CveDB() throws DatabaseException {
|
||||||
open();
|
open();
|
||||||
final String databaseProductName = determineDatabaseProductName();
|
final String databaseProductName = determineDatabaseProductName();
|
||||||
batchSupported = isBatchSupportedFor(databaseProductName);
|
|
||||||
statementBundle = databaseProductName != null ?
|
statementBundle = databaseProductName != null ?
|
||||||
ResourceBundle.getBundle("data/dbStatements", new Locale(databaseProductName)) :
|
ResourceBundle.getBundle("data/dbStatements", new Locale(databaseProductName)) :
|
||||||
ResourceBundle.getBundle("data/dbStatements");
|
ResourceBundle.getBundle("data/dbStatements");
|
||||||
@@ -151,21 +149,6 @@ public final class CveDB {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns if the database supports batch execution of statements.
|
|
||||||
*
|
|
||||||
* @param databaseProductName the product name of the database
|
|
||||||
* @return if the database supports batch execution
|
|
||||||
*/
|
|
||||||
private boolean isBatchSupportedFor(String databaseProductName) {
|
|
||||||
if ("mysql".equalsIgnoreCase(databaseProductName)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// per default we do not support batch execution
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the database connection.
|
* Returns the database connection.
|
||||||
*
|
*
|
||||||
@@ -227,7 +210,7 @@ public final class CveDB {
|
|||||||
throws DatabaseException {
|
throws DatabaseException {
|
||||||
|
|
||||||
final EnumMap<PreparedStatementCveDb, PreparedStatement> result = new EnumMap<PreparedStatementCveDb, PreparedStatement>(PreparedStatementCveDb.class);
|
final EnumMap<PreparedStatementCveDb, PreparedStatement> result = new EnumMap<PreparedStatementCveDb, PreparedStatement>(PreparedStatementCveDb.class);
|
||||||
for (PreparedStatementCveDb key : PreparedStatementCveDb.values()) {
|
for (PreparedStatementCveDb key : values()) {
|
||||||
final String statementString = statementBundle.getString(key.name());
|
final String statementString = statementBundle.getString(key.name());
|
||||||
final PreparedStatement preparedStatement;
|
final PreparedStatement preparedStatement;
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user