src/jdk.jshell/share/classes/jdk/jshell/tool/JavaShellToolBuilder.java
changeset 47840 e0f08a49f3e3
parent 47216 71c04702a3d5
equal deleted inserted replaced
47839:314ac2e2db63 47840:e0f08a49f3e3
   184     JavaShellToolBuilder promptCapture(boolean capture);
   184     JavaShellToolBuilder promptCapture(boolean capture);
   185 
   185 
   186     /**
   186     /**
   187      * Run an instance of the Java shell tool as configured by the other methods
   187      * Run an instance of the Java shell tool as configured by the other methods
   188      * in this interface.  This call is not destructive, more than one call of
   188      * in this interface.  This call is not destructive, more than one call of
   189      * this method may be made from a configured builder.
   189      * this method may be made from a configured builder. The  exit code from
       
   190      * the Java shell tool is ignored.
   190      *
   191      *
   191      * @param arguments the command-line arguments (including options), if any
   192      * @param arguments the command-line arguments (including options), if any
   192      * @throws Exception an unexpected fatal exception
   193      * @throws Exception an unexpected fatal exception
   193      */
   194      */
   194     void run(String... arguments) throws Exception;
   195     void run(String... arguments) throws Exception;
       
   196 
       
   197     /**
       
   198      * Run an instance of the Java shell tool as configured by the other methods
       
   199      * in this interface.  This call is not destructive, more than one call of
       
   200      * this method may be made from a configured builder.
       
   201      *
       
   202      * @implSpec The default implementation always returns zero. Implementations
       
   203      * of this interface should override this method, returning the exit status.
       
   204      *
       
   205      * @param arguments the command-line arguments (including options), if any
       
   206      * @throws Exception an unexpected fatal exception
       
   207      * @return the exit status with which the tool explicitly exited (if any),
       
   208      * otherwise 0 for success or 1 for failure
       
   209      */
       
   210     default int start(String... arguments) throws Exception {
       
   211         run(arguments);
       
   212         return 0;
       
   213     }
   195 }
   214 }