RFR: 8302496: Runtime.exit incorrectly says it never throws an exception

Alan Bateman alanb at openjdk.org
Fri Apr 28 06:56:54 UTC 2023


On Thu, 27 Apr 2023 23:06:42 GMT, Stuart Marks <smarks at openjdk.org> wrote:

> Textual specification clarifications.

src/java.base/share/classes/java/lang/Runtime.java line 146:

> 144:      * If a security manager is present and its {@link SecurityManager#checkExit checkExit}
> 145:      * method disallows exiting with the specified status, throws {@link SecurityException}.
> 146:      * Otherwise, this method blocks indefinitely; it neither returns nor throws an exception

The SM is not long for this world.  So I'm in two minds about it making a farewell appearance in the first paragraph of the method description when we know we will have to remove this text very soon.  If we really need to change this now then maybe it could be reduced to "When a security manager is not set, this method never returns ..." so that the distraction of checkExit is not in the first paragraph.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13706#discussion_r1179989339


More information about the core-libs-dev mailing list