Buggy code:
public class ScriptRunner implements LowLevelAccess { private static final int maxStackSize = 1000 ; private Stack < ScriptRunner . Context > stackContext = new Stack < ScriptRunner . Context > ( ) ; private ScriptRunner . Context currentContext ; private HashMap < String , ArrayList < StackInstructions > > compiledFiles ; StandardIOService ioService ; public ScriptRunner ( HashMap < String , ArrayList < StackInstructions > > cf ) { } public void setIOService ( StandardIOService ioSrv ) { } private volatile boolean running = false ; private volatile boolean end = false ; private volatile boolean pause = false ; private volatile boolean oneStep = false ; private volatile boolean stepByStepMode = false ; private boolean waitingForInput = false ; private void reset ( ) { } public boolean isRunning ( ) { } public boolean isEnded ( ) { } public void run ( ) throws ScriptException { reset ( ) ; if ( ( ioService ) == null ) { Log . d ( "###" , "The<seq2seq4repair_space>script<seq2seq4repair_space>runner<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>have<seq2seq4repair_space>an<seq2seq4repair_space>attached<seq2seq4repair_space>I//O<seq2seq4repair_space>service" ) ; return ; } running = true ; while ( true ) { while ( ( ( pause ) && ( ! ( oneStep ) ) ) && ( ! ( end ) ) ) try { Thread . sleep ( 5 ) ; } catch ( InterruptedException e ) { } if ( end ) break ; RunnableInstruction ri = currentContext . getNextInstruction ( ) ; if ( ri != null ) try { runInstruction ( ri ) ; } catch ( ScriptException e ) { e . setCat ( "Running" ) ; e . setFile ( currentContext . file ) ; <START_BUG> e . setLine ( ( ( currentContext . line ) - 1 ) ) ; <END_BUG> running = false ; throw e ; } else end = true ; oneStep = false ; } running = false ; } public void nextStep ( ) { } public void enableStepByStep ( ) { } public void disableStepByStep ( ) { } public void pause ( ) { } public void resume ( ) { } public void stop ( ) { } private void runInstruction ( StackInstructions . RunnableInstruction instruction ) throws ScriptException { } public void setNextLine ( int line ) { } public void pushContext ( String file , int line , Data left , Data right ) throws ScriptException { } public Data getParameterLeft ( ) throws ScriptException { } public Data getParameterRight ( ) throws ScriptException { } public boolean conditionalStructureSkipped ( ) { } public void skipConditionalStructure ( ) { } public void endConditionalStructure ( ) { } public void enterConditionalStructure ( ) { } public void popContext ( ) { } public void popContext ( Data returnedData ) { } public void end ( ) { } public Data createVar ( String name , int type ) throws ScriptException { } public boolean isExistingVar ( String name ) { } public Data getVar ( String name ) { } private static final int DELTA_SLEEP_TIME = 1 ; public void sleep ( long millis ) { } private long startTime = 0 ; public void initializeTime ( ) { } public double getElapsedTime ( ) { } public void out ( CommandOut cmd , StringBuilder data ) { } public void in ( CommandIn cmd , Data data ) { } private class Context { String file ; int line ; Stack < Boolean > skipCondStruct = new Stack < Boolean > ( ) ; HashMap < String , Data > localVariable = new HashMap < String , Data > ( ) ; Stack < Data > stackData = new Stack < Data > ( ) ; StackInstructions instructions = null ; ArrayList < StackInstructions > fileInstructions = null ; final Data paramLeft ; final Data paramRight ; Context ( String _file , int _line , Data _paramLeft , Data _paramRight ) { } RunnableInstruction getNextInstruction ( ) { } } No newline ; at end ; of file ; }

Fix:
e . setLine ( currentContext . line ) ;