All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.sonar.l10n.java.rules.squid.S1147.html Maven / Gradle / Ivy

There is a newer version: 8.6.0.37351
Show newest version

Calling System.exit(int status) or Rutime.getRuntime().exit(int status) calls the shutdown hooks and shuts downs the entire Java virtual machine. Calling Runtime.getRuntime().halt(int) does an immediate shutdown, without calling the shutdown hooks, and skipping finalization.

Each of these methods should be used with extreme care, and only when the intent is to stop the whole Java process. For instance, none of them should be called from applications running in a J2EE container.

Noncompliant Code Example

System.exit(0);
Runtime.getRuntime().exit(0);
Runtime.getRuntime().halt(0);

Exceptions

These methods are ignored inside main.

See





© 2015 - 2025 Weber Informatics LLC | Privacy Policy