Buggy code:
public class JMeterThread implements Serializable , Runnable { private static final Logger log = LoggingManager . getLoggerForClass ( ) ; private static final long serialVersionUID = 221L ; private int initialDelay = 0 ; private Controller controller ; private boolean running ; private HashTree testTree ; private transient TestCompiler compiler ; private JMeterThreadMonitor monitor ; private String threadName ; private transient JMeterContext threadContext ; private transient JMeterVariables threadVars ; private Collection testListeners ; private transient ListenerNotifier notifier ; private int threadNum = 0 ; private long startTime = 0 ; private long endTime = 0 ; private boolean scheduler = false ; private ThreadGroup threadGroup ; private StandardJMeterEngine engine = null ; private boolean onErrorStopTest ; private boolean onErrorStopThread ; public static final String PACKAGE_OBJECT = "JMeterThread.pack" ; public static final String LAST_SAMPLE_OK = "JMeterThread.last_sample_ok" ; 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 ( ) { } private void stopScheduler ( ) { } private void startScheduler ( ) { } public void setThreadName ( String threadName ) { } private static final boolean startEarlier = JMeterUtils . getPropDefault ( "jmeterthread.startearlier" , true ) ; private static final boolean reversePostProcessors = JMeterUtils . getPropDefault ( "jmeterthread.reversePostProcessors" , false ) ; public void run ( ) { } protected void initRun ( ) { } private void threadStarted ( ) { } private void threadFinished ( ) { } private static class Traverser implements HashTreeTraverser { private boolean isStart = false ; private Traverser ( boolean start ) { } public void addNode ( Object node , HashTree subTree ) { } public void subtractNode ( ) { } public void processPath ( ) { } } public String getThreadName ( ) { } public void stop ( ) { } private void stopTest ( ) { } private void stopThread ( ) { } private void checkAssertions ( List assertions , SampleResult result ) { Iterator iter = assertions . iterator ( ) ; while ( iter . hasNext ( ) ) { Assertion assertion = ( ( Assertion ) ( iter . next ( ) ) ) ; TestBeanHelper . prepare ( ( ( TestElement ) ( assertion ) ) ) ; AssertionResult assertionResult = assertion . getResult ( result ) ; result . setSuccessful ( ( ( result . isSuccessful ( ) ) && ( ! ( ( assertionResult . isError ( ) ) || ( assertionResult . isFailure ( ) ) ) ) ) ) ; result . addAssertionResult ( assertionResult ) ; } <START_BUG> threadContext . getVariables ( ) . put ( JMeterThread . LAST_SAMPLE_OK , JOrphanUtils . booleanToString ( result . isSuccessful ( ) ) ) ; <END_BUG> } 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 ) { } } public void setEngine ( StandardJMeterEngine engine ) { } public void setOnErrorStopTest ( boolean b ) { } public void setOnErrorStopThread ( boolean b ) { } public ThreadGroup getThreadGroup ( ) { } public void setThreadGroup ( ThreadGroup group ) { } }

Fix:
threadContext . getVariables ( ) . put ( JMeterThread . LAST_SAMPLE_OK , Boolean . toString ( result . isSuccessful ( ) ) ) ;