continued work on threading and code improvement

This commit is contained in:
Jeremy Long
2017-09-03 09:05:55 -04:00
parent 795de6f9ea
commit ab5de24518
158 changed files with 1266 additions and 964 deletions

View File

@@ -94,10 +94,5 @@ Copyright (c) 2014 - Jeremy Long. All Rights Reserved.
<artifactId>logback-classic</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>annotations</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
</project>

View File

@@ -25,12 +25,14 @@ import java.io.ObjectStreamClass;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import javax.annotation.concurrent.NotThreadSafe;
/**
* An ObjectInputStream that will only deserialize expected classes.
*
* @author Jeremy Long
*/
@NotThreadSafe
public class ExpectedObjectInputStream extends ObjectInputStream {
/**

View File

@@ -445,12 +445,15 @@ public final class Settings {
}
//</editor-fold>
/**
* Initialize the settings object.
*/
public Settings() {
initialize(PROPERTIES_FILE);
}
/**
* This class loads the settings from the given properties file.
* Initialize the settings object using the given properties file.
*
* @param propertiesFilePath the path to the base properties file to load
*/
@@ -463,7 +466,7 @@ public final class Settings {
*
* @param propertiesFilePath the path to the settings property file
*/
private final void initialize(String propertiesFilePath) {
private void initialize(String propertiesFilePath) {
props = new Properties();
try (InputStream in = FileUtils.getResourceAsStream(propertiesFilePath)) {
props.load(in);
@@ -970,8 +973,7 @@ public final class Settings {
throw new IOException(String.format("Unable to create the data directory '%s'",
(path == null) ? "unknown" : path.getAbsolutePath()));
}
/**
* Generates a new temporary file name that is guaranteed to be unique.
*

View File

@@ -46,7 +46,6 @@ public class ExpectedObjectInputStreamTest {
out.writeObject(data);
out.flush();
byte[] buf = mem.toByteArray();
out.close();
ByteArrayInputStream in = new ByteArrayInputStream(buf);
ExpectedObjectInputStream instance = new ExpectedObjectInputStream(in, "java.util.ArrayList", "org.owasp.dependencycheck.utils.SimplePojo", "java.lang.Integer", "java.lang.Number");
instance.readObject();

View File

@@ -23,6 +23,10 @@ import java.io.Serializable;
* @author jeremy
*/
public class SimplePojo implements Serializable {
/**
* The serial version UID for serialization.
*/
private static final long serialVersionUID = 1L;
public String s = "3";
public Integer i = 3;