You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by st...@apache.org on 2006/06/22 02:07:28 UTC

svn commit: r416182 - /ant/core/trunk/src/main/org/apache/tools/ant/Main.java

Author: stevel
Date: Wed Jun 21 17:07:27 2006
New Revision: 416182

URL: http://svn.apache.org/viewvc?rev=416182&view=rev
Log:
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...

Modified:
    ant/core/trunk/src/main/org/apache/tools/ant/Main.java

Modified: ant/core/trunk/src/main/org/apache/tools/ant/Main.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/Main.java?rev=416182&r1=416181&r2=416182&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/Main.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/Main.java Wed Jun 21 17:07:27 2006
@@ -176,7 +176,8 @@
         } catch (Throwable exc) {
             handleLogfile();
             printMessage(exc);
-            System.exit(1);
+            exit(1);
+            return;
         }
 
         if (additionalUserProperties != null) {
@@ -210,6 +211,16 @@
         } 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);
     }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Re: svn commit: r416182 - /ant/core/trunk/src/main/org/apache/tools/ant/Main.java

Posted by Alexey Solofnenko <tr...@gmail.com>.
I need this feature. Please keep it.

- Alexey.

On 6/21/06, Kev Jackson <fo...@gmail.com> wrote:
>
>
> On 22 Jun 2006, at 07:07, stevel@apache.org wrote:
>
> > Author: stevel
> > Date: Wed Jun 21 17:07:27 2006
> > New Revision: 416182
> >
> > URL: http://svn.apache.org/viewvc?rev=416182&view=rev
> > Log:
> > 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...
>
> I can see this being useful in the case of relying on a third party
> to produce the exit code and then passing it through.  Also it gives
> you the opportunity to perform cleanup in the exit method before just
> bombing out to System.exit
>
> I have no problems as I can imagine a general usecase for this -
> still like to hear what others think
> Kev
>
> --
> "Government is begotten of aggression, by aggression" - Herbert Spencer
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
>
>


-- 
Alexey N. Solofnenko trelony at gmail.com
home: http://trelony.cjb.net/
Pleasant Hill, CA (GMT-8 hours usually)

Re: svn commit: r416182 - /ant/core/trunk/src/main/org/apache/tools/ant/Main.java

Posted by Kev Jackson <fo...@gmail.com>.
On 22 Jun 2006, at 07:07, stevel@apache.org wrote:

> Author: stevel
> Date: Wed Jun 21 17:07:27 2006
> New Revision: 416182
>
> URL: http://svn.apache.org/viewvc?rev=416182&view=rev
> Log:
> 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...

I can see this being useful in the case of relying on a third party  
to produce the exit code and then passing it through.  Also it gives  
you the opportunity to perform cleanup in the exit method before just  
bombing out to System.exit

I have no problems as I can imagine a general usecase for this -  
still like to hear what others think
Kev

--
"Government is begotten of aggression, by aggression" - Herbert Spencer


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org