Buggy code:
public class JBossAsManagedContainer extends AbstractDeployableContainer < JBossAsManagedConfiguration > { private final Logger log = Logger . getLogger ( JBossAsManagedContainer . class . getName ( ) ) ; private MBeanServerConnectionProvider provider ; private Process process ; private Thread shutdownThread ; @ Override public Class < JBossAsManagedConfiguration > getConfigurationClass ( ) { } @ Override public void setup ( JBossAsManagedConfiguration configuration ) { } @ Override public void start ( ) throws LifecycleException { try { JBossAsManagedConfiguration config = getContainerConfiguration ( ) ; final String jbossHomeDir = config . getJbossHome ( ) ; final String additionalJavaOpts = config . getJavaVmArguments ( ) ; File modulesJar = new File ( ( jbossHomeDir + "//jboss-modules.jar" ) ) ; if ( ( modulesJar . exists ( ) ) == false ) throw new IllegalStateException ( ( "Cannot<seq2seq4repair_space>find:<seq2seq4repair_space>" + modulesJar ) ) ; List < String > cmd = new ArrayList < String > ( ) ; if ( ( config . getJavaHome ( ) ) != null ) { cmd . add ( ( ( config . getJavaHome ( ) ) + "//bin//java" ) ) ; } else { cmd . add ( "java" ) ; } if ( additionalJavaOpts != null ) { for ( String opt : additionalJavaOpts . split ( "\\s+" ) ) { cmd . add ( opt ) ; } } cmd . add ( ( "-Djboss.home.dir=" + jbossHomeDir ) ) ; cmd . add ( ( ( "-Dorg.jboss.boot.log.file=" + jbossHomeDir ) + "//standalone//log//boot.log" ) ) ; cmd . add ( ( ( "-Dlogging.configuration=file:" + jbossHomeDir ) + "//standalone//configuration//logging.properties" ) ) ; cmd . add ( "-jar" ) ; cmd . add ( modulesJar . getAbsolutePath ( ) ) ; cmd . add ( "-mp" ) ; cmd . add ( ( jbossHomeDir + "//modules" ) ) ; cmd . add ( "-logmodule" ) ; cmd . add ( "org.jboss.logmanager" ) ; cmd . add ( "-jaxpmodule" ) ; cmd . add ( "javax.xml.jaxp-provider" ) ; cmd . add ( "org.jboss.as.standalone" ) ; log . info ( ( "Starting<seq2seq4repair_space>container<seq2seq4repair_space>with:<seq2seq4repair_space>" + ( cmd . toString ( ) ) ) ) ; ProcessBuilder processBuilder = new ProcessBuilder ( cmd ) ; processBuilder . redirectErrorStream ( true ) ; process = processBuilder . start ( ) ; new Thread ( new JBossAsManagedContainer . ConsoleConsumer ( ) ) . start ( ) ; long timeout = ( config . getStartupTimeoutInSeconds ( ) ) * 1000 ; boolean serverAvailable = false ; do { Thread . sleep ( 100 ) ; timeout -= 100 ; serverAvailable = isServerStarted ( ) ; } while ( ( timeout > 0 ) && ( serverAvailable == false ) ) ; if ( ! serverAvailable ) { <START_BUG> throw new TimeoutException ( String . format ( "Managed<seq2seq4repair_space>server<seq2seq4repair_space>was<seq2seq4repair_space>not<seq2seq4repair_space>started<seq2seq4repair_space>within<seq2seq4repair_space>[%d]<seq2seq4repair_space>ms" , timeout ) ) ; <END_BUG> } boolean testRunnerMBeanAvaialble = false ; MBeanServerConnection mbeanServer = null ; do { Thread . sleep ( 100 ) ; timeout -= 100 ; if ( mbeanServer == null ) { try { mbeanServer = getMBeanServerConnection ( ) ; } catch ( Exception ex ) { } } testRunnerMBeanAvaialble = ( mbeanServer != null ) && ( mbeanServer . isRegistered ( OBJECT_NAME ) ) ; } while ( ( timeout > 0 ) && ( testRunnerMBeanAvaialble == false ) ) ; final Process proc = process ; shutdownThread = new Thread ( new Runnable ( ) { @ Override public void run ( ) { if ( proc != null ) { proc . destroy ( ) ; try { proc . waitFor ( ) ; } catch ( InterruptedException e ) { throw new RuntimeException ( e ) ; } } } } ) ; Runtime . getRuntime ( ) . addShutdownHook ( shutdownThread ) ; if ( ! testRunnerMBeanAvaialble ) { throw new RuntimeException ( ( ( ( ( "Process<seq2seq4repair_space>did<seq2seq4repair_space>not<seq2seq4repair_space>start<seq2seq4repair_space>in<seq2seq4repair_space>time,<seq2seq4repair_space>waited<seq2seq4repair_space>for<seq2seq4repair_space>" + ( config . getStartupTimeoutInSeconds ( ) ) ) + "<seq2seq4repair_space>ms.<seq2seq4repair_space>" ) + ( OBJECT_NAME ) ) + "<seq2seq4repair_space>was<seq2seq4repair_space>never<seq2seq4repair_space>registered" ) ) ; } } catch ( Exception e ) { throw new LifecycleException ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>start<seq2seq4repair_space>container" , e ) ; } } @ Override public void stop ( ) throws LifecycleException { } protected MBeanServerConnection getMBeanServerConnection ( ) { } private boolean isServerStarted ( ) { } private class ConsoleConsumer implements Runnable { @ Override public void run ( ) { } } }

Fix:
throw new TimeoutException ( String . format ( "Managed<seq2seq4repair_space>server<seq2seq4repair_space>was<seq2seq4repair_space>not<seq2seq4repair_space>started<seq2seq4repair_space>within<seq2seq4repair_space>[%d]<seq2seq4repair_space>ms" , ( ( config . getStartupTimeoutInSeconds ( ) ) * 1000 ) ) ) ;