checkstyle corrections

This commit is contained in:
Jeremy Long
2017-05-27 12:06:49 -04:00
parent d5df4920c7
commit 1b14c10085
5 changed files with 11 additions and 10 deletions

View File

@@ -815,7 +815,7 @@ public class Engine implements FileFilter {
public void writeReports(String applicationName, String groupId, String artifactId,
String version, File outputDir, String format) throws ReportException {
DatabaseProperties prop = database.getDatabaseProperties();
final DatabaseProperties prop = database.getDatabaseProperties();
final ReportGenerator r = new ReportGenerator(applicationName, groupId, artifactId, version, dependencies, getAnalyzers(), prop);
try {
r.write(outputDir.getAbsolutePath(), format);

View File

@@ -18,12 +18,9 @@
package org.owasp.dependencycheck.agent;
import java.io.File;
import java.io.IOException;
import java.util.List;
import org.owasp.dependencycheck.Engine;
import org.owasp.dependencycheck.data.nvdcve.CveDB;
import org.owasp.dependencycheck.data.nvdcve.DatabaseException;
import org.owasp.dependencycheck.data.nvdcve.DatabaseProperties;
import org.owasp.dependencycheck.dependency.Dependency;
import org.owasp.dependencycheck.dependency.Identifier;
import org.owasp.dependencycheck.dependency.Vulnerability;

View File

@@ -95,6 +95,9 @@ public final class CveDB implements AutoCloseable {
*/
private final EnumMap<PreparedStatementCveDb, PreparedStatement> preparedStatements = new EnumMap<>(PreparedStatementCveDb.class);
/**
* Cache for CVE lookups; used to speed up the vulnerability search process.
*/
@SuppressWarnings("unchecked")
private final Map<String, List<Vulnerability>> vulnerabilitiesForCpeCache = Collections.synchronizedMap(new ReferenceMap(HARD, SOFT));
@@ -508,8 +511,9 @@ public final class CveDB implements AutoCloseable {
}
/**
* Clears cache. Should be called whenever something is modified. While this is not the optimal cache eviction
* strategy, this is good enough for typical usage (update DB and then only read) and it is easier to maintain
* Clears cache. Should be called whenever something is modified. While this
* is not the optimal cache eviction strategy, this is good enough for
* typical usage (update DB and then only read) and it is easier to maintain
* the code.
*
* It should be also called when DB is closed.

View File

@@ -124,7 +124,7 @@ public class EscapeTool {
return "";
}
boolean addComma = false;
StringBuilder sb = new StringBuilder();
final StringBuilder sb = new StringBuilder();
for (Identifier id : ids) {
if (!"cpe".equals(id.getType())) {
if (addComma) {
@@ -150,7 +150,7 @@ public class EscapeTool {
return "";
}
boolean addComma = false;
StringBuilder sb = new StringBuilder();
final StringBuilder sb = new StringBuilder();
for (Identifier id : ids) {
if ("cpe".equals(id.getType())) {
if (addComma) {

View File

@@ -169,7 +169,7 @@ public class ReportGenerator {
final String scanDate = dateFormat.print(dt);
final String scanDateXML = dateFormatXML.print(dt);
VelocityContext ctxt = new VelocityContext();
final VelocityContext ctxt = new VelocityContext();
ctxt.put("applicationName", applicationName);
ctxt.put("dependencies", dependencies);
ctxt.put("analyzers", analyzers);
@@ -202,7 +202,7 @@ public class ReportGenerator {
if (reportFormat != null) {
write(outputLocation, reportFormat);
} else {
File out = getReportFile(outputLocation, null);
final File out = getReportFile(outputLocation, null);
if (out.isDirectory()) {
throw new ReportException("Unable to write non-standard VSL output to a directory, please specify a file name");
}