On Mon, 16 Oct 2023 14:37:03 GMT, Weijun Wang <[email protected]> wrote:
>> src/jdk.jartool/share/classes/sun/security/tools/jarsigner/Main.java line
>> 155:
>>
>>> 153: private static void exit(int exitCode) {
>>> 154: throw new ExitException(exitCode);
>>> 155: }
>>
>> I don't see much benefit of this method since it's one-line to one-line. For
>> other classes, it seems that value 0 is ok, but here an exception is thrown
>> regardless of exit code value. Is this really intended?
>
> I'll inline the throw statements.
>
> Yes, no matter if it's zero or not. Throwing the exception makes sure it
> jumps back to `run` immediately. If the code is 0, then the `main` method
> will return normally.
Hmm, interesting usage. Thanks for the explanation.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/15951#discussion_r1364229675