From a1448bb07d8e4377c5562b9ee25ce040da749ab6 Mon Sep 17 00:00:00 2001 From: Steve Loughran Date: Thu, 22 Jun 2006 00:07:27 +0000 Subject: [PATCH] Little something to make it easier for things that subclass main to change its exit behaviour. Its been on my HDD for a while. If people object to it, I'll roll it back, as its not anything I'm actively using... git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@416182 13f79535-47bb-0310-9956-ffa450edef68 --- src/main/org/apache/tools/ant/Main.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main/org/apache/tools/ant/Main.java b/src/main/org/apache/tools/ant/Main.java index ea05fd894..c4ceaf4d0 100644 --- a/src/main/org/apache/tools/ant/Main.java +++ b/src/main/org/apache/tools/ant/Main.java @@ -176,7 +176,8 @@ public class Main implements AntMain { } catch (Throwable exc) { handleLogfile(); printMessage(exc); - System.exit(1); + exit(1); + return; } if (additionalUserProperties != null) { @@ -210,6 +211,16 @@ public class Main implements AntMain { } finally { handleLogfile(); } + exit(exitCode); + } + + /** + * This operation is expected to call {@link System#exit(int)}, which + * is what the base version does. however, the option to do something + * different is there. + * @param exitCode code to exit with + */ + protected void exit(int exitCode) { System.exit(exitCode); }