Browse Source

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
master
Steve Loughran 19 years ago
parent
commit
a1448bb07d
1 changed files with 12 additions and 1 deletions
  1. +12
    -1
      src/main/org/apache/tools/ant/Main.java

+ 12
- 1
src/main/org/apache/tools/ant/Main.java View File

@@ -176,7 +176,8 @@ public class Main implements AntMain {
} catch (Throwable exc) { } catch (Throwable exc) {
handleLogfile(); handleLogfile();
printMessage(exc); printMessage(exc);
System.exit(1);
exit(1);
return;
} }


if (additionalUserProperties != null) { if (additionalUserProperties != null) {
@@ -210,6 +211,16 @@ public class Main implements AntMain {
} finally { } finally {
handleLogfile(); 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); System.exit(exitCode);
} }




Loading…
Cancel
Save