ARTEMIS-1414 potential PrintStream leak
This commit is contained in:
parent
8666cb61d8
commit
c98cb8a60c
|
@ -237,11 +237,10 @@ public class ArtemisCreatePlugin extends ArtemisAbstractPlugin {
|
|||
throw new MojoExecutionException(e.getMessage(), e);
|
||||
}
|
||||
|
||||
PrintStream commandLineStream = new PrintStream(outputStream);
|
||||
commandLineStream.println("# These are the commands used to create " + instance.getName());
|
||||
commandLineStream.println(getCommandline(listCommands));
|
||||
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("###################################################################################################");
|
||||
|
|
Loading…
Reference in New Issue