Buggy code:
public class CustomCLIExecutor { public static final int MANAGEMENT_NATIVE_PORT = 9999 ; public static final int MANAGEMENT_HTTP_PORT = 9990 ; public static final int MANAGEMENT_HTTPS_PORT = 9993 ; public static final String NATIVE_CONTROLLER = ( ( "remoting:////" + ( TestSuiteEnvironment . getServerAddress ( ) ) ) + ":" ) + ( CustomCLIExecutor . MANAGEMENT_NATIVE_PORT ) ; public static final String HTTP_CONTROLLER = ( ( "http-remoting:////" + ( TestSuiteEnvironment . getServerAddress ( ) ) ) + ":" ) + ( CustomCLIExecutor . MANAGEMENT_HTTP_PORT ) ; public static final String HTTPS_CONTROLLER = ( ( "https-remoting:////" + ( TestSuiteEnvironment . getServerAddress ( ) ) ) + ":" ) + ( CustomCLIExecutor . MANAGEMENT_HTTPS_PORT ) ; private static Logger LOGGER = Logger . getLogger ( CustomCLIExecutor . class ) ; private static final int CLI_PROC_TIMEOUT = 5000 ; private static final int STATUS_CHECK_INTERVAL = 2000 ; public static String execute ( File cliConfigFile , String operation ) { } public static String execute ( File cliConfigFile , String operation , String controller ) { } public static String execute ( File cliConfigFile , String operation , String controller , boolean logFailure ) { String cliOutput ; String jbossDist = System . getProperty ( "jboss.dist" ) ; if ( jbossDist == null ) { fail ( "jboss.dist<seq2seq4repair_space>system<seq2seq4repair_space>property<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>set" ) ; } final String modulePath = System . getProperty ( "module.path" ) ; if ( modulePath == null ) { fail ( "module.path<seq2seq4repair_space>system<seq2seq4repair_space>property<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>set" ) ; } final ProcessBuilder builder = new ProcessBuilder ( ) ; builder . redirectErrorStream ( true ) ; final List < String > command = new ArrayList < String > ( ) ; <START_BUG> command . add ( TestSuiteEnvironment . getJavaPath ( ) ) ; <END_BUG> TestSuiteEnvironment . getIpv6Args ( command ) ; if ( cliConfigFile != null ) { command . add ( ( "-Djboss.cli.config=" + ( cliConfigFile . getAbsolutePath ( ) ) ) ) ; } else { command . add ( ( ( ( ( ( "-Djboss.cli.config=" + jbossDist ) + ( File . separator ) ) + "bin" ) + ( File . separator ) ) + "jboss-cli.xml" ) ) ; } command . add ( "-jar" ) ; command . add ( ( ( jbossDist + ( File . separatorChar ) ) + "jboss-modules.jar" ) ) ; command . add ( "-mp" ) ; command . add ( modulePath ) ; command . add ( "org.jboss.as.cli" ) ; command . add ( "-c" ) ; command . add ( ( "--controller=" + controller ) ) ; command . add ( operation ) ; builder . command ( command ) ; Process cliProc = null ; try { cliProc = builder . start ( ) ; } catch ( IOException e ) { fail ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>start<seq2seq4repair_space>CLI<seq2seq4repair_space>process:<seq2seq4repair_space>" + ( e . getLocalizedMessage ( ) ) ) ) ; } final InputStream cliStream = cliProc . getInputStream ( ) ; final StringBuilder cliOutBuf = new StringBuilder ( ) ; boolean wait = true ; int runningTime = 0 ; int exitCode = 0 ; do { try { Thread . sleep ( CustomCLIExecutor . STATUS_CHECK_INTERVAL ) ; } catch ( InterruptedException e ) { } runningTime += CustomCLIExecutor . STATUS_CHECK_INTERVAL ; CustomCLIExecutor . readStream ( cliOutBuf , cliStream ) ; try { exitCode = cliProc . exitValue ( ) ; wait = false ; CustomCLIExecutor . readStream ( cliOutBuf , cliStream ) ; } catch ( IllegalThreadStateException e ) { } if ( runningTime >= ( CustomCLIExecutor . CLI_PROC_TIMEOUT ) ) { CustomCLIExecutor . readStream ( cliOutBuf , cliStream ) ; cliProc . destroy ( ) ; wait = false ; } } while ( wait ) ; cliOutput = cliOutBuf . toString ( ) ; if ( logFailure && ( exitCode != 0 ) ) { CustomCLIExecutor . LOGGER . info ( ( ( "Command's<seq2seq4repair_space>output:<seq2seq4repair_space>'" + cliOutput ) + "'" ) ) ; try { int bytesTotal = cliProc . getErrorStream ( ) . available ( ) ; if ( bytesTotal > 0 ) { final byte [ ] bytes = new byte [ bytesTotal ] ; cliProc . getErrorStream ( ) . read ( bytes ) ; CustomCLIExecutor . LOGGER . info ( ( ( "Command's<seq2seq4repair_space>error<seq2seq4repair_space>log:<seq2seq4repair_space>'" + ( new String ( bytes ) ) ) + "'" ) ) ; } else { CustomCLIExecutor . LOGGER . info ( "No<seq2seq4repair_space>output<seq2seq4repair_space>data<seq2seq4repair_space>for<seq2seq4repair_space>the<seq2seq4repair_space>command." ) ; } } catch ( IOException e ) { fail ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>read<seq2seq4repair_space>command's<seq2seq4repair_space>error<seq2seq4repair_space>output:<seq2seq4repair_space>" + ( e . getLocalizedMessage ( ) ) ) ) ; } } return ( exitCode + ":<seq2seq4repair_space>" ) + cliOutput ; } private static void readStream ( final StringBuilder cliOutBuf , InputStream cliStream ) { } public static void waitForServerToReload ( int timeout , String controller ) throws Exception { } }

Fix:
command . add ( "java" ) ;