Buggy code:
public class JMeterThread implements Serializable , Runnable { private static transient Logger log = Hierarchy . getDefaultHierarchy ( ) . getLoggerFor ( "jmeter.engine" ) ; static Map samplers = new HashMap ( ) ; int initialDelay = 0 ; Controller controller ; private boolean running ; HashTree testTree ; TestCompiler compiler ; JMeterThreadMonitor monitor ; String threadName ; JMeterContext threadContext ; JMeterVariables threadVars ; Collection testListeners ; ListenerNotifier notifier ; int threadNum = 0 ; long startTime = 0 ; long endTime = 0 ; private boolean scheduler = false ; public JMeterThread ( ) { } public JMeterThread ( HashTree test , JMeterThreadMonitor monitor , ListenerNotifier note ) { } public void setInitialContext ( JMeterContext context ) { } public boolean isScheduled ( ) { } public void setScheduled ( boolean sche ) { } public void setStartTime ( long stime ) { } public long getStartTime ( ) { } public void setEndTime ( long etime ) { } public long getEndTime ( ) { } public void stopScheduler ( ) { } public void startScheduler ( ) { } public void setThreadName ( String threadName ) { } public void run ( ) { try { threadContext = JMeterContextService . getContext ( ) ; threadContext . setVariables ( threadVars ) ; threadContext . setThreadNum ( getThreadNum ( ) ) ; testTree . traverse ( compiler ) ; running = true ; Sampler entry = null ; rampUpDelay ( ) ; if ( scheduler ) { startScheduler ( ) ; } JMeterThread . log . info ( ( ( "Thread<seq2seq4repair_space>" + ( Thread . currentThread ( ) . getName ( ) ) ) + "<seq2seq4repair_space>started" ) ) ; controller . initialize ( ) ; controller . addIterationListener ( new JMeterThread . IterationListener ( ) ) ; threadContext . setSamplingStarted ( true ) ; while ( running ) { Sampler sam ; while ( ( running ) && ( ( sam = controller . next ( ) ) != null ) ) { try { threadContext . setCurrentSampler ( sam ) ; SamplePackage pack = compiler . configureSampler ( sam ) ; delay ( pack . getTimers ( ) ) ; SampleResult result = pack . getSampler ( ) . sample ( null ) ; result . setThreadName ( threadName ) ; result . setTimeStamp ( System . currentTimeMillis ( ) ) ; threadContext . setPreviousResult ( result ) ; runPostProcessors ( pack . getPostProcessors ( ) ) ; checkAssertions ( pack . getAssertions ( ) , result ) ; notifyListeners ( pack . getSampleListeners ( ) , result ) ; compiler . done ( pack ) ; if ( scheduler ) { stopScheduler ( ) ; } } catch ( Exception e ) { JMeterThread . log . error ( "" , e ) ; } } if ( controller . isDone ( ) ) { running = false ; } } } finally { <START_BUG> threadContext . setSamplingStarted ( false ) ; <END_BUG> JMeterThread . log . info ( ( ( "Thread<seq2seq4repair_space>" + ( threadName ) ) + "<seq2seq4repair_space>is<seq2seq4repair_space>done" ) ) ; monitor . threadFinished ( this ) ; } } public String getThreadName ( ) { } public void stop ( ) { } private void checkAssertions ( List assertions , SampleResult result ) { } private void runPostProcessors ( List extractors ) { } private void delay ( List timers ) { } private void notifyTestListeners ( ) { } private void notifyListeners ( List listeners , SampleResult result ) { } public void setInitialDelay ( int delay ) { } private void rampUpDelay ( ) { } public int getThreadNum ( ) { } public void setThreadNum ( int threadNum ) { } private class IterationListener implements LoopIterationListener { public void iterationStart ( LoopIterationEvent iterEvent ) { } } }

Fix:
threadContext . clear ( ) ;