Program: 31676
Project: 31676
Buggy source:
@Override public void postIteration(final MasterContext<DTMasterParams,DTWorkerParams> context){
  long start=System.currentTimeMillis();
  final int tmpModelFactor=DTrainUtils.tmpModelFactor(context.getTotalIteration());
  if (isRF) {
    if (context.getCurrentIteration() % (tmpModelFactor * 2) == 0) {
      Thread tmpModelPersistThread=new Thread(new Runnable(){
        @Override public void run(){
          Path out=new Path(context.getProps().getProperty(CommonConstants.GUAGUA_OUTPUT));
          writeModelToFileSystem(context.getMasterResult().getTrees(),out);
          saveTmpModelToHDFS(context.getCurrentIteration(),context.getMasterResult().getTrees());
        }
      }
,"String_Node_Str");
      tmpModelPersistThread.setDaemon(true);
      tmpModelPersistThread.start();
    }
  }
 else   if (isGBDT) {
    if (this.treeNum >= 10 && context.getMasterResult().isSwitchToNextTree() && (context.getMasterResult().getTmpTrees().size() - 1) % (this.treeNum / 10) == 0) {
      final List<TreeNode> trees=context.getMasterResult().getTmpTrees();
      if (trees.size() > 1) {
        Thread tmpModelPersistThread=new Thread(new Runnable(){
          @Override public void run(){
            List<TreeNode> subTrees=trees.subList(0,trees.size() - 1);
            Path out=new Path(context.getProps().getProperty(CommonConstants.GUAGUA_OUTPUT));
            writeModelToFileSystem(subTrees,out);
            saveTmpModelToHDFS(subTrees.size(),subTrees);
          }
        }
,"String_Node_Str");
        tmpModelPersistThread.setDaemon(true);
        tmpModelPersistThread.start();
      }
    }
  }
  updateProgressLog(context);
  LOG.debug("String_Node_Str",(System.currentTimeMillis() - start));
}

Fixed version (ground truth):
@Override public void postIteration(final MasterContext<DTMasterParams,DTWorkerParams> context){
  long start=System.currentTimeMillis();
  final int tmpModelFactor=DTrainUtils.tmpModelFactor(context.getTotalIteration());
  if (isRF) {
    if (context.getCurrentIteration() % (tmpModelFactor * 2) == 0) {
      Thread tmpModelPersistThread=new Thread(new Runnable(){
        @Override public void run(){
          Path out=new Path(context.getProps().getProperty(CommonConstants.GUAGUA_OUTPUT));
          if (!context.getMasterResult().isHalt() && context.getCurrentIteration() != context.getTotalIteration()) {
            writeModelToFileSystem(context.getMasterResult().getTrees(),out);
          }
          saveTmpModelToHDFS(context.getCurrentIteration(),context.getMasterResult().getTrees());
        }
      }
,"String_Node_Str");
      tmpModelPersistThread.setDaemon(true);
      tmpModelPersistThread.start();
    }
  }
 else   if (isGBDT) {
    if (this.treeNum >= 10 && context.getMasterResult().isSwitchToNextTree() && (context.getMasterResult().getTmpTrees().size() - 1) % (this.treeNum / 10) == 0) {
      final List<TreeNode> trees=context.getMasterResult().getTmpTrees();
      if (trees.size() > 1) {
        Thread tmpModelPersistThread=new Thread(new Runnable(){
          @Override public void run(){
            List<TreeNode> subTrees=trees.subList(0,trees.size() - 1);
            Path out=new Path(context.getProps().getProperty(CommonConstants.GUAGUA_OUTPUT));
            if (!context.getMasterResult().isHalt() && context.getCurrentIteration() != context.getTotalIteration()) {
              writeModelToFileSystem(subTrees,out);
            }
            saveTmpModelToHDFS(subTrees.size(),subTrees);
          }
        }
,"String_Node_Str");
        tmpModelPersistThread.setDaemon(true);
        tmpModelPersistThread.start();
      }
    }
  }
  updateProgressLog(context);
  LOG.debug("String_Node_Str",(System.currentTimeMillis() - start));
}