Buggy code:
public final class NetworkServerTestSetup extends BaseTestSetup { private static final long WAIT_TIME = 40000 ; private static final int SLEEP_TIME = 100 ; public static final String HOST_OPTION = "-h" ; private static long waitTime = NetworkServerTestSetup . WAIT_TIME ; private FileOutputStream serverOutput ; private final boolean asCommand ; private final boolean startServerAtSetup ; private final boolean useSeparateProcess ; private final boolean serverShouldComeUp ; private final String [ ] systemProperties ; private String [ ] startupArgs ; private SpawnedProcess spawnedServer ; public NetworkServerTestSetup ( Test test , boolean asCommand ) { } public NetworkServerTestSetup ( Test test , boolean asCommand , boolean startServerAtSetup ) { } public NetworkServerTestSetup ( Test test , String [ ] systemProperties , String [ ] startupArgs , boolean serverShouldComeUp ) { } protected void setUp ( ) throws Exception { } private void startWithAPI ( ) throws Exception { } private void startWithCommand ( ) throws Exception { } private SpawnedProcess startSeparateProcess ( ) throws Exception { ArrayList al = new ArrayList ( ) ; String classpath = BaseTestCase . getSystemProperty ( "java.class.path" ) ; boolean skipHostName = false ; <START_BUG> al . add ( "java" ) ; <END_BUG> al . add ( "-classpath" ) ; al . add ( classpath ) ; if ( ! ( TestConfiguration . loadingFromJars ( ) ) ) { boolean setNoSecurityManager = true ; for ( int i = 0 ; i < ( systemProperties . length ) ; i ++ ) { if ( systemProperties [ i ] . startsWith ( "java.security." ) ) { setNoSecurityManager = false ; break ; } } for ( int i = 0 ; i < ( startupArgs . length ) ; i ++ ) { if ( startupArgs [ i ] . equals ( "-noSecurityManager" ) ) { setNoSecurityManager = false ; break ; } } if ( setNoSecurityManager ) { String [ ] newArgs = new String [ ( startupArgs . length ) + 1 ] ; System . arraycopy ( startupArgs , 0 , newArgs , 0 , startupArgs . length ) ; newArgs [ ( ( newArgs . length ) - 1 ) ] = "-noSecurityManager" ; startupArgs = newArgs ; } } int count = systemProperties . length ; for ( int i = 0 ; i < count ; i ++ ) { al . add ( ( "-D" + ( systemProperties [ i ] ) ) ) ; } al . add ( "org.apache.derby.drda.NetworkServerControl" ) ; count = startupArgs . length ; for ( int i = 0 ; i < count ; i ++ ) { if ( NetworkServerTestSetup . HOST_OPTION . equals ( startupArgs [ i ] ) ) { skipHostName = true ; } } String [ ] defaultArgs = NetworkServerTestSetup . getDefaultStartupArgs ( skipHostName ) ; count = defaultArgs . length ; for ( int i = 0 ; i < count ; i ++ ) { al . add ( defaultArgs [ i ] ) ; } count = startupArgs . length ; for ( int i = 0 ; i < count ; i ++ ) { al . add ( startupArgs [ i ] ) ; } final String [ ] command = new String [ al . size ( ) ] ; al . toArray ( command ) ; Process serverProcess ; try { serverProcess = ( ( Process ) ( AccessController . doPrivileged ( new PrivilegedExceptionAction ( ) { public Object run ( ) throws IOException { return Runtime . getRuntime ( ) . exec ( command ) ; } } ) ) ) ; } catch ( PrivilegedActionException e ) { throw e . getException ( ) ; } return new SpawnedProcess ( serverProcess , "SpawnedNetworkServer" ) ; } public SpawnedProcess getServerProcess ( ) { } protected void tearDown ( ) throws Exception { } public static String [ ] getDefaultStartupArgs ( boolean skipHostName ) { } private NetworkServerControl networkServerController ; public static NetworkServerControl getNetworkServerControl ( ) throws Exception { } public static NetworkServerControl getNetworkServerControl ( int port ) throws Exception { } public static NetworkServerControl getNetworkServerControlDefault ( ) throws Exception { } public static void waitForServerStart ( NetworkServerControl networkServerController ) throws InterruptedException { } public static void setWaitTime ( long newWaitTime ) { } public static void setDefaultWaitTime ( ) { } public static boolean pingForServerUp ( NetworkServerControl networkServerController , Process serverProcess , boolean expectServerUp ) throws InterruptedException { } private static boolean vetPing ( Throwable t ) { } private static boolean isDRDAerror ( Throwable t ) { } public static boolean pingForServerStart ( NetworkServerControl control ) throws InterruptedException { } }

Fix:
al . add ( BaseTestCase . getJavaExecutableName ( ) ) ;