Buggy code:
public synchronized void threadFinished ( JMeterThread thread ) { } public synchronized void stopTest ( ) { } public synchronized void stopTest ( boolean b ) { } private class StopTest implements Runnable { boolean now ; private StopTest ( ) { } private StopTest ( boolean b ) { } public void run ( ) { if ( running ) { running = false ; if ( now ) { tellThreadsToStop ( ) ; } else { stopAllThreads ( ) ; } try { Thread . sleep ( ( 10 * ( allThreads . size ( ) ) ) ) ; } catch ( InterruptedException e ) { } boolean stopped = verifyThreadsStopped ( ) ; if ( stopped || ( now ) ) { notifyTestListenersOfEnd ( ) ; } } } } public void run ( ) { StandardJMeterEngine . log . info ( "Running<seq2seq4repair_space>the<seq2seq4repair_space>test!" ) ; running = true ; StandardJMeterEngine . testList = new ArrayList ( ) ; SearchByClass testPlan = new SearchByClass ( TestPlan . class ) ; getTestTree ( ) . traverse ( testPlan ) ; Object [ ] plan = testPlan . getSearchResults ( ) . toArray ( ) ; if ( ( plan . length ) == 0 ) { System . err . println ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>find<seq2seq4repair_space>the<seq2seq4repair_space>TestPlan!" ) ; StandardJMeterEngine . log . error ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>find<seq2seq4repair_space>the<seq2seq4repair_space>TestPlan!" ) ; System . exit ( 1 ) ; } if ( ( ( TestPlan ) ( plan [ 0 ] ) ) . isSerialized ( ) ) { serialized = true ; } JMeterContextService . startTest ( ) ; compileTree ( ) ; testListeners = new SearchByClass ( TestListener . class ) ; getTestTree ( ) . traverse ( testListeners ) ; Collection col = testListeners . getSearchResults ( ) ; col . addAll ( StandardJMeterEngine . testList ) ; StandardJMeterEngine . testList = null ; notifyTestListenersOfStart ( ) ; getTestTree ( ) . traverse ( new TurnElementsOn ( ) ) ; List testLevelElements = new LinkedList ( getTestTree ( ) . list ( getTestTree ( ) . getArray ( ) [ 0 ] ) ) ; removeThreadGroups ( testLevelElements ) ; SearchByClass searcher = new SearchByClass ( ThreadGroup . class ) ; setMode ( ) ; getTestTree ( ) . traverse ( searcher ) ; TestCompiler . initialize ( ) ; JMeterThread [ ] threads ; Iterator iter = searcher . getSearchResults ( ) . iterator ( ) ; System . gc ( ) ; notifier = new ListenerNotifier ( ) ; schcdule_run = true ; JMeterContextService . getContext ( ) . setSamplingStarted ( true ) ; int groupCount = 0 ; while ( iter . hasNext ( ) ) { groupCount ++ ; ThreadGroup group = ( ( ThreadGroup ) ( iter . next ( ) ) ) ; int numThreads = group . getNumThreads ( ) ; boolean onErrorStopTest = group . getOnErrorStopTest ( ) ; boolean onErrorStopThread = group . getOnErrorStopThread ( ) ; String groupName = group . getName ( ) ; int rampUp = group . getRampUp ( ) ; float perThreadDelay = ( ( float ) ( rampUp * 1000 ) ) // ( ( float ) ( numThreads ) ) ; threads = new JMeterThread [ numThreads ] ; StandardJMeterEngine . log . info ( ( ( ( ( ( ( "Starting<seq2seq4repair_space>" + numThreads ) + "<seq2seq4repair_space>threads<seq2seq4repair_space>for<seq2seq4repair_space>group<seq2seq4repair_space>" ) + groupName ) + ".<seq2seq4repair_space>Ramp<seq2seq4repair_space>up<seq2seq4repair_space>=<seq2seq4repair_space>" ) + rampUp ) + "." ) ) ; if ( onErrorStopTest ) { StandardJMeterEngine . log . info ( "Test<seq2seq4repair_space>will<seq2seq4repair_space>stop<seq2seq4repair_space>on<seq2seq4repair_space>error" ) ; } else if ( onErrorStopThread ) { StandardJMeterEngine . log . info ( "Thread<seq2seq4repair_space>will<seq2seq4repair_space>stop<seq2seq4repair_space>on<seq2seq4repair_space>error" ) ; } else { StandardJMeterEngine . log . info ( "Continue<seq2seq4repair_space>on<seq2seq4repair_space>error" ) ; } for ( int i = 0 ; ( running ) && ( i < ( threads . length ) ) ; i ++ ) { ListedHashTree threadGroupTree = ( ( ListedHashTree ) ( searcher . getSubTree ( group ) ) ) ; threadGroupTree . add ( group , testLevelElements ) ; threads [ i ] = new JMeterThread ( cloneTree ( threadGroupTree ) , this , notifier ) ; threads [ i ] . setThreadNum ( i ) ; threads [ i ] . setInitialContext ( JMeterContextService . getContext ( ) ) ; threads [ i ] . setInitialDelay ( ( ( int ) ( perThreadDelay * ( ( float ) ( i ) ) ) ) ) ; <START_BUG> threads [ i ] . setThreadName ( ( ( ( groupName + groupCount ) + "-" ) + ( i + 1 ) ) ) ; <END_BUG> scheduleThread ( threads [ i ] , group ) ; threads [ i ] . setEngine ( this ) ; threads [ i ] . setOnErrorStopTest ( onErrorStopTest ) ; threads [ i ] . setOnErrorStopThread ( onErrorStopThread ) ; Thread newThread = new Thread ( threads [ i ] ) ; newThread . setName ( threads [ i ] . getThreadName ( ) ) ; allThreads . put ( threads [ i ] , newThread ) ; if ( ( ( serialized ) && ( ! ( iter . hasNext ( ) ) ) ) && ( i == ( ( threads . length ) - 1 ) ) ) { serialized = false ; } newThread . start ( ) ; } schcdule_run = false ; if ( serialized ) { while ( ( running ) && ( ( allThreads . size ( ) ) > 0 ) ) { try { Thread . sleep ( 1000 ) ; } catch ( InterruptedException e ) { } } } } } private void scheduleThread ( JMeterThread thread , ThreadGroup group ) { } public synchronized void pauseTest ( int milis ) { } private boolean verifyThreadsStopped ( ) { } private void tellThreadsToStop ( ) { } public void askThreadsToStop ( ) { } private void stopAllThreads ( ) { } public void exit ( ) { } }

Fix:
threads [ i ] . setThreadName ( ( ( ( ( groupName + "<seq2seq4repair_space>" ) + groupCount ) + "-" ) + ( i + 1 ) ) ) ;