ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/frontends CLIMain.java
Date Fri, 01 Mar 2002 10:35:03 GMT
donaldp     02/03/01 02:35:03

  Modified:    proposal/myrmidon/src/java/org/apache/myrmidon/frontends
                        CLIMain.java
  Log:
  Wrap block with finally to make sure System.exit is called and with correct exitCode
  
  Revision  Changes    Path
  1.27      +7 -5      jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/frontends/CLIMain.java
  
  Index: CLIMain.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/frontends/CLIMain.java,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- CLIMain.java	21 Feb 2002 09:28:03 -0000	1.26
  +++ CLIMain.java	1 Mar 2002 10:35:03 -0000	1.27
  @@ -42,7 +42,7 @@
    * to run project.
    *
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
  - * @version $Revision: 1.26 $ $Date: 2002/02/21 09:28:03 $
  + * @version $Revision: 1.27 $ $Date: 2002/03/01 10:35:03 $
    */
   public class CLIMain
       extends AbstractLogEnabled
  @@ -112,8 +112,8 @@
        */
       public static void main( final String[] args )
       {
  +        int exitCode = 0;
           final CLIMain main = new CLIMain();
  -
           try
           {
               main.execute( args );
  @@ -123,10 +123,12 @@
               final String message =
                   REZ.getString( "error-message", ExceptionUtil.printStackTrace( throwable
) );
               System.err.println( message );
  -            System.exit( -1 );
  +            exitCode = -1;
  +        }
  +        finally
  +        {
  +            System.exit( exitCode );
           }
  -
  -        System.exit( 0 );
       }
   
       /**
  
  
  

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


Mime
View raw message