On Tue, 23 Feb 2021 03:43:41 GMT, Chris Plummer <cjplum...@openjdk.org> wrote:
>> It seems error prone to have to call finishApp() manually in order to see >> the error log. Since LingeredApp.startApp calls finishApp() on exceptions, >> shouldn't startAppExactJvmOpts do the same thing? > > Although you have a point, you've also pointed out another problem with this > fix. I think users of `startApp()` are already going to see the output twice > because of the `finishApp()` call present there. By adding yet another > `finishApp()` call to `startAppExactJvmOpts()`, now they will see it 3 times. > > If you want to "move" the `finishApp()` call from `startApp()` to > `startAppExactJvmOpts()`, then at least that will maintain the status quo > with existing `startApp()` users, but we still have an issue with the output > appearing twice, even before this change, and with this change it is now more > common as `startAppExactJvmOpts()` will also start seeing it. > > Maybe `finishApp()` should maintain an `alreadyCalled` flag so it does > nothing on subsequent calls. @plummercj @iklam Thanks for review. I will add a flag for finishApp so we will not call it more than once. ------------- PR: https://git.openjdk.java.net/jdk/pull/2679