ARTEMIS-1414 potential PrintStream leak

This commit is contained in:
Justin Bertram 2018-01-23 09:51:11 -06:00 committed by Michael Pearce
parent 8666cb61d8
commit c98cb8a60c
1 changed files with 3 additions and 6 deletions

View File

@ -237,11 +237,10 @@ public class ArtemisCreatePlugin extends ArtemisAbstractPlugin {
throw new MojoExecutionException(e.getMessage(), e);
}
PrintStream commandLineStream = new PrintStream(outputStream);
try (PrintStream commandLineStream = new PrintStream(outputStream)) {
commandLineStream.println("# These are the commands used to create " + instance.getName());
commandLineStream.println(getCommandline(listCommands));
try {
Artemis.execute(home, null, listCommands);
if (configuration != null) {
@ -266,8 +265,6 @@ public class ArtemisCreatePlugin extends ArtemisAbstractPlugin {
}
}
commandLineStream.close();
FileUtil.makeExec(commandLine);
getLog().info("###################################################################################################");