Buggy code:
public class BatchFormulaCalculater extends Thread { private int startID ; private int endID ; private List < Integer > skipIDList ; private Semaphore semp ; public BatchFormulaCalculater ( int startID , int endID , List < Integer > skipIDList , Semaphore semp ) { } public void run ( ) { } public void batchCalculate ( ) throws Exception { long startTime = System . currentTimeMillis ( ) ; File sampleFile = new File ( Config . getAttri ( "SAMPLE_FILE_PATH" ) ) ; <START_BUG> File exprFile = new File ( Config . getAttri ( "REPLACED_EXPRESSION_FILE_PATH" ) ) ; <END_BUG> BufferedReader sampleFileBufferedReader = new BufferedReader ( new FileReader ( sampleFile ) ) ; BufferedReader exprFileBufferedReader = new BufferedReader ( new FileReader ( exprFile ) ) ; File statLogFile = new File ( ( ( ( ( ( Config . getAttri ( "FORMULA_STATICATICS_LOG_PREFIX" ) ) + "_" ) + ( new Integer ( startID ) ) ) + "_" ) + ( new Integer ( endID ) ) ) ) ; if ( statLogFile . exists ( ) ) { statLogFile . delete ( ) ; } statLogFile . createNewFile ( ) ; FileWriter statLogFileWriter = new FileWriter ( statLogFile ) ; File formulaCalculatedFile = new File ( ( ( ( ( ( Config . getAttri ( "FORMULA_CALCULATED_SAVE_PATH_PREFIX" ) ) + "_" ) + ( new Integer ( startID ) ) ) + "_" ) + ( new Integer ( endID ) ) ) ) ; if ( formulaCalculatedFile . exists ( ) ) { formulaCalculatedFile . delete ( ) ; } formulaCalculatedFile . createNewFile ( ) ; FileWriter formulaCalculatedFileWriter = new FileWriter ( formulaCalculatedFile ) ; FormulaCalculater fc = new FormulaCalculater ( ) ; String sampleItem = null ; while ( ( sampleItem = sampleFileBufferedReader . readLine ( ) ) != null ) { if ( ( Util . getIDFromIndex ( Util . getIndexFromItem ( sampleItem ) ) ) >= ( startID ) ) { break ; } } String exprItem = null ; while ( ( exprItem = exprFileBufferedReader . readLine ( ) ) != null ) { if ( ( Util . getIDFromIndex ( Util . getIndexFromItem ( exprItem ) ) ) >= ( startID ) ) { break ; } } int failedCalculateItemCount = 0 ; int lackOfFormulaCount = 0 ; int skipCount = 0 ; int lastWrittenSampleID = - 1 ; int sampleItemID = Util . getIDFromIndex ( Util . getIndexFromItem ( sampleItem ) ) ; int exprItemID = Util . getIDFromIndex ( Util . getIndexFromItem ( exprItem ) ) ; while ( ( ( ( sampleItem != null ) && ( exprItem != null ) ) && ( sampleItemID <= ( endID ) ) ) && ( exprItemID <= ( endID ) ) ) { if ( ( ( skipIDList ) != null ) && ( skipIDList . contains ( new Integer ( sampleItemID ) ) ) ) { if ( lastWrittenSampleID != sampleItemID ) { skipCount ++ ; statLogFileWriter . write ( ( ( "[SKIP]:" + ( Util . getIndexFromItem ( sampleItem ) ) ) + "\n" ) ) ; formulaCalculatedFileWriter . write ( ( sampleItem + "\n" ) ) ; lastWrittenSampleID = sampleItemID ; } sampleItem = sampleFileBufferedReader . readLine ( ) ; sampleItemID = Util . getIDFromIndex ( Util . getIndexFromItem ( sampleItem ) ) ; continue ; } if ( sampleItemID == exprItemID ) { List < String > exprList = new ArrayList < String > ( ) ; exprList . add ( Util . getContentFromItem ( exprItem ) ) ; while ( ( exprItem = exprFileBufferedReader . readLine ( ) ) != null ) { int newExprItemID = Util . getIDFromIndex ( Util . getIndexFromItem ( exprItem ) ) ; if ( newExprItemID != sampleItemID ) { break ; } exprList . add ( Util . getContentFromItem ( exprItem ) ) ; } String calculatedResult = fc . calculateToString ( exprList , Util . getContentFromItem ( sampleItem ) , Util . getIndexFromItem ( sampleItem ) , statLogFileWriter ) ; if ( calculatedResult == null ) { calculatedResult = Util . getContentFromItem ( sampleItem ) ; failedCalculateItemCount ++ ; } formulaCalculatedFileWriter . write ( ( ( ( ( Util . getIndexFromItem ( sampleItem ) ) + ":" ) + calculatedResult ) + "\n" ) ) ; lastWrittenSampleID = sampleItemID ; } else if ( sampleItemID > exprItemID ) { exprItem = exprFileBufferedReader . readLine ( ) ; } else { if ( lastWrittenSampleID != sampleItemID ) { lackOfFormulaCount ++ ; statLogFileWriter . write ( ( ( "[LACK]:" + ( Util . getIndexFromItem ( sampleItem ) ) ) + "\n" ) ) ; formulaCalculatedFileWriter . write ( ( sampleItem + "\n" ) ) ; lastWrittenSampleID = sampleItemID ; } sampleItem = sampleFileBufferedReader . readLine ( ) ; } sampleItemID = Util . getIDFromIndex ( Util . getIndexFromItem ( sampleItem ) ) ; exprItemID = Util . getIDFromIndex ( Util . getIndexFromItem ( exprItem ) ) ; } long endTime = System . currentTimeMillis ( ) ; statLogFileWriter . write ( ( ( "Total<seq2seq4repair_space>all<seq2seq4repair_space>formula<seq2seq4repair_space>failed<seq2seq4repair_space>item<seq2seq4repair_space>count:" + failedCalculateItemCount ) + "\n" ) ) ; statLogFileWriter . write ( ( ( "Total<seq2seq4repair_space>lack<seq2seq4repair_space>of<seq2seq4repair_space>formula<seq2seq4repair_space>item<seq2seq4repair_space>count:" + lackOfFormulaCount ) + "\n" ) ) ; statLogFileWriter . write ( ( ( "Total<seq2seq4repair_space>skip<seq2seq4repair_space>item<seq2seq4repair_space>count:" + skipCount ) + "\n" ) ) ; statLogFileWriter . write ( ( ( "Total<seq2seq4repair_space>time<seq2seq4repair_space>used:" + ( ( endTime - startTime ) // 1000 ) ) + "s\n" ) ) ; sampleFileBufferedReader . close ( ) ; exprFileBufferedReader . close ( ) ; formulaCalculatedFileWriter . close ( ) ; statLogFileWriter . close ( ) ; } }

Fix:
File exprFile = new File ( Config . getAttri ( "EXPRESSION_FILE_PATH" ) ) ;