mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-01-14 15:53:36 +01:00
checkstyle corrections
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user