// Intercept Runtime.getRuntime().halt, and check if the caller is allowed to use it, if not // wrap it in a ExitTrappedException public static void runtimeHaltCalled(Runtime runtime, int status) { ExitVisitor.checkAccess(); runtime.halt(status); }