checkstyle, findbugs, and pmd corrections

Former-commit-id: 85573816e82855343af1d41576ffc2479e8595ed
This commit is contained in:
Jeremy Long
2014-12-06 13:16:06 -05:00
parent e1d4599a93
commit 4555b02592
8 changed files with 79 additions and 32 deletions

View File

@@ -353,6 +353,7 @@ public class DependencyCheckMojo extends ReportAggregationMojo {
/**
* Initializes a new <code>Engine</code> that can be used for scanning.
*
* @param project the current MavenProject
* @return a newly instantiated <code>Engine</code>
* @throws DatabaseException thrown if there is a database exception
*/

View File

@@ -53,7 +53,7 @@ public class Engine extends org.owasp.dependencycheck.Engine {
*/
public Engine(MavenProject project) throws DatabaseException {
this.currentProject = project;
MavenProject parent = getRootParent();
final MavenProject parent = getRootParent();
if (parent != null && parent.getContextValue("dependency-check-data-was-updated") != null) {
System.setProperty(Settings.KEYS.AUTO_UPDATE, Boolean.FALSE.toString());
}
@@ -94,7 +94,7 @@ public class Engine extends org.owasp.dependencycheck.Engine {
/**
* Closes the given analyzer. This skips closing the CPEAnalyzer.
*
* @param analyzer
* @param analyzer the analyzer to close
*/
@Override
protected void closeAnalyzer(Analyzer analyzer) {
@@ -111,7 +111,7 @@ public class Engine extends org.owasp.dependencycheck.Engine {
* Closes the CPEAnalyzer if it has been created and persisted in the root parent MavenProject context.
*/
public void cleanupFinal() {
CPEAnalyzer cpe = getPreviouslyLoadedAnalyzer();
final CPEAnalyzer cpe = getPreviouslyLoadedAnalyzer();
if (cpe != null) {
cpe.close();
}
@@ -124,7 +124,7 @@ public class Engine extends org.owasp.dependencycheck.Engine {
*/
private CPEAnalyzer getPreviouslyLoadedAnalyzer() {
CPEAnalyzer cpe = null;
MavenProject project = getRootParent();
final MavenProject project = getRootParent();
if (project != null) {
cpe = (CPEAnalyzer) project.getContextValue(CPE_ANALYZER_KEY);
}
@@ -137,7 +137,7 @@ public class Engine extends org.owasp.dependencycheck.Engine {
* @param cpe the CPEAnalyzer to store
*/
private void storeCPEAnalyzer(CPEAnalyzer cpe) {
MavenProject p = getRootParent();
final MavenProject p = getRootParent();
if (p != null) {
p.setContextValue(CPE_ANALYZER_KEY, cpe);
}