Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

ERR09-EX0: It is permissible for a command-line utility to call System.exit(), for example, when the required number of arguments are not input [Bloch 2008][ESA 2005].

Risk Assessment

Allowing unauthorized calls to System.exit() may lead to denial of service (DoS).

...

On Android, System.exit() should not be used because it will terminate the virtual machine abruptly, ignoring the activity lifecycle which may prevent proper garbage collection.

Bibliography

[API 2006]

Method checkExit(), class Runtime, method addShutdownHook

[Austin 2000]

Writing a Security Manager

[Darwin 2004]

9.5, The Finalize Method

[ESA 2005]

Rule 78. Restrict the use of the System.exit method

[Goetz 2006]

7.4, JVM Shutdown

[Kalinovsky 2004]

Chapter 16, Intercepting a Call to System.exit

 

...

      Rule 07: Exceptional Behavior (ERR)      Rule 08: Visibility and Atomicity (VNA)Image Added      Image Added