RFR: 8316964: Security tools should not call System.exit [v3]

Valerie Peng valeriep at openjdk.org
Fri Oct 13 19:34:09 UTC 2023


On Tue, 10 Oct 2023 21:11:21 GMT, Weijun Wang <weijun at openjdk.org> wrote:

>> Remove most `System.exit()` calls in various security tools and only leave one in the `main` method. This paves the way to convert them to JSR 199 tools.
>> 
>> Note: before this change, the behavior of a successful `main()` method execution is not consistent. Sometimes the method returns silently, sometimes a `System.exit(0)` is called somewhere. After this change, the method always returns silently. This makes sure that existing programs that calls the `main` method directly will continue and does not exit the VM.
>
> Weijun Wang has updated the pull request incrementally with one additional commit since the last revision:
> 
>   typo

src/java.security.jgss/windows/classes/sun/security/krb5/internal/tools/Klist.java line 155:

> 153:             } else {
> 154:                 displayMessage("Credentials cache");
> 155:                 return -1;

Make displayMessage(String) return -1 and just use "return displayMessage();"? (Other displayXXX() also returns int)

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/15951#discussion_r1358736269



More information about the security-dev mailing list