coverity recommended changes

This commit is contained in:
Jeremy Long
2016-10-23 07:20:24 -04:00
parent e751b7b814
commit 773ac019f8
3 changed files with 4 additions and 4 deletions

View File

@@ -38,7 +38,7 @@ public class AntLoggerAdapter extends MarkerIgnoringBase {
/** /**
* A reference to the Ant task used for logging. * A reference to the Ant task used for logging.
*/ */
private Task task; private transient Task task;
/** /**
* Constructs an Ant Logger Adapter. * Constructs an Ant Logger Adapter.

View File

@@ -259,7 +259,7 @@ public class CveDB {
* *
* @return the properties from the database * @return the properties from the database
*/ */
Properties getProperties() { synchronized Properties getProperties() {
final Properties prop = new Properties(); final Properties prop = new Properties();
PreparedStatement ps = null; PreparedStatement ps = null;
ResultSet rs = null; ResultSet rs = null;
@@ -285,7 +285,7 @@ public class CveDB {
* @param key the property key * @param key the property key
* @param value the property value * @param value the property value
*/ */
void saveProperty(String key, String value) { synchronized void saveProperty(String key, String value) {
try { try {
try { try {
final PreparedStatement mergeProperty = getConnection().prepareStatement(statementBundle.getString("MERGE_PROPERTY")); final PreparedStatement mergeProperty = getConnection().prepareStatement(statementBundle.getString("MERGE_PROPERTY"));

View File

@@ -423,7 +423,7 @@ public final class Settings {
* @param deleteTemporary flag indicating whether any temporary directories * @param deleteTemporary flag indicating whether any temporary directories
* generated should be removed * generated should be removed
*/ */
public static void cleanup(boolean deleteTemporary) { public static synchronized void cleanup(boolean deleteTemporary) {
if (deleteTemporary && tempDirectory != null && tempDirectory.exists()) { if (deleteTemporary && tempDirectory != null && tempDirectory.exists()) {
FileUtils.delete(tempDirectory); FileUtils.delete(tempDirectory);
tempDirectory = null; tempDirectory = null;