mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-03-19 15:54:52 +01:00
checkstyle and findbugs corrections
Former-commit-id: 2bf90876b7c88bccb93135a0be43f01e49c3cd30
This commit is contained in:
@@ -92,7 +92,7 @@ public class DependencyCheckMojo extends ReportAggregationMojo {
|
|||||||
* The path to the verbose log.
|
* The path to the verbose log.
|
||||||
*/
|
*/
|
||||||
@Parameter(property = "logfile", defaultValue = "")
|
@Parameter(property = "logfile", defaultValue = "")
|
||||||
private String logFile;
|
private String logFile = null;
|
||||||
/**
|
/**
|
||||||
* The output directory. This generally maps to "target".
|
* The output directory. This generally maps to "target".
|
||||||
*/
|
*/
|
||||||
@@ -815,21 +815,41 @@ public class DependencyCheckMojo extends ReportAggregationMojo {
|
|||||||
File file = null;
|
File file = null;
|
||||||
if (engine != null && getProject().getContextValue(this.getDataFileContextKey()) == null) {
|
if (engine != null && getProject().getContextValue(this.getDataFileContextKey()) == null) {
|
||||||
file = new File(getProject().getBuild().getDirectory(), getDataFileName());
|
file = new File(getProject().getBuild().getDirectory(), getDataFileName());
|
||||||
|
OutputStream os = null;
|
||||||
|
OutputStream bos = null;
|
||||||
|
ObjectOutput out = null;
|
||||||
try {
|
try {
|
||||||
final OutputStream os = new FileOutputStream(file);
|
os = new FileOutputStream(file);
|
||||||
final OutputStream bos = new BufferedOutputStream(os);
|
bos = new BufferedOutputStream(os);
|
||||||
final ObjectOutput out = new ObjectOutputStream(bos);
|
out = new ObjectOutputStream(bos);
|
||||||
try {
|
out.writeObject(engine.getDependencies());
|
||||||
out.writeObject(engine.getDependencies());
|
out.flush();
|
||||||
out.flush();
|
|
||||||
} finally {
|
|
||||||
out.close();
|
|
||||||
}
|
|
||||||
//getProject().setContextValue(this.getDataFileContextKey(), file.getAbsolutePath());
|
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
LOGGER.log(Level.WARNING, "Unable to create data file used for report aggregation; "
|
LOGGER.log(Level.WARNING, "Unable to create data file used for report aggregation; "
|
||||||
+ "if report aggregation is being used the results may be incomplete.");
|
+ "if report aggregation is being used the results may be incomplete.");
|
||||||
LOGGER.log(Level.FINE, ex.getMessage(), ex);
|
LOGGER.log(Level.FINE, ex.getMessage(), ex);
|
||||||
|
} finally {
|
||||||
|
if (out != null) {
|
||||||
|
try {
|
||||||
|
out.close();
|
||||||
|
} catch (IOException ex) {
|
||||||
|
LOGGER.log(Level.FINEST, "ignore", ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (bos != null) {
|
||||||
|
try {
|
||||||
|
bos.close();
|
||||||
|
} catch (IOException ex) {
|
||||||
|
LOGGER.log(Level.FINEST, "ignore", ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (os != null) {
|
||||||
|
try {
|
||||||
|
os.close();
|
||||||
|
} catch (IOException ex) {
|
||||||
|
LOGGER.log(Level.FINEST, "ignore", ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return file;
|
return file;
|
||||||
|
|||||||
@@ -394,7 +394,7 @@ public abstract class ReportAggregationMojo extends AbstractMojo implements Mave
|
|||||||
proj.getName());
|
proj.getName());
|
||||||
LOGGER.warning(msg);
|
LOGGER.warning(msg);
|
||||||
} else {
|
} else {
|
||||||
File outputFile = new File((String) path);
|
final File outputFile = new File((String) path);
|
||||||
if (outputFile.exists()) {
|
if (outputFile.exists()) {
|
||||||
files.add(outputFile);
|
files.add(outputFile);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user