Program: 31947
Project: 31947
Buggy source:
@Override public Map<Integer,NodeStats> call() throws Exception {
  List<Integer> nodeIndexes=new ArrayList<Integer>(trees.size());
  for (  Data data : DTWorker.this.trainingData) {
    nodeIndexes.clear();
    if (DTWorker.this.isRF) {
      for (      TreeNode treeNode : trees) {
        Node predictNode=predictNodeIndex(treeNode.getNode(),data,false);
        nodeIndexes.add(predictNode.getId());
      }
    }
    if (DTWorker.this.isGBDT) {
      int currTreeIndex=trees.size() - 1;
      Node predictNode=predictNodeIndex(trees.get(currTreeIndex).getNode(),data,false);
      nodeIndexes.add(predictNode.getId());
    }
    for (    Map.Entry<Integer,TreeNode> entry : localTodoNodes.entrySet()) {
      Node todoNode=entry.getValue().getNode();
      int treeId=entry.getValue().getTreeId();
      int currPredictIndex=0;
      if (DTWorker.this.isRF) {
        currPredictIndex=nodeIndexes.get(entry.getValue().getTreeId());
      }
      if (DTWorker.this.isGBDT) {
        currPredictIndex=nodeIndexes.get(0);
      }
      if (todoNode.getId() == currPredictIndex) {
        List<Integer> features=entry.getValue().getFeatures();
        if (features.isEmpty()) {
          features=getAllValidFeatures();
        }
        for (        Integer columnNum : features) {
          double[] featuerStatistic=localStatistics.get(entry.getKey()).getFeatureStatistics().get(columnNum);
          float weight=data.subsampleWeights[treeId % data.subsampleWeights.length];
          if (Float.compare(weight,0f) != 0) {
            short binIndex=data.inputs[DTWorker.this.inputIndexMap.get(columnNum)];
            DTWorker.this.impurity.featureUpdate(featuerStatistic,binIndex,data.output,data.significance,weight);
          }
        }
      }
    }
  }
  return localStatistics;
}

Fixed version (ground truth):
@Override public Map<Integer,NodeStats> call() throws Exception {
  List<Integer> nodeIndexes=new ArrayList<Integer>(trees.size());
  for (  Data data : DTWorker.this.trainingData) {
    nodeIndexes.clear();
    if (DTWorker.this.isRF) {
      for (      TreeNode treeNode : trees) {
        if (treeNode.getNode().getId() == Node.INVALID_INDEX) {
          nodeIndexes.add(Node.INVALID_INDEX);
        }
 else {
          Node predictNode=predictNodeIndex(treeNode.getNode(),data,false);
          nodeIndexes.add(predictNode.getId());
        }
      }
    }
    if (DTWorker.this.isGBDT) {
      int currTreeIndex=trees.size() - 1;
      Node predictNode=predictNodeIndex(trees.get(currTreeIndex).getNode(),data,false);
      nodeIndexes.add(predictNode.getId());
    }
    for (    Map.Entry<Integer,TreeNode> entry : localTodoNodes.entrySet()) {
      Node todoNode=entry.getValue().getNode();
      int treeId=entry.getValue().getTreeId();
      int currPredictIndex=0;
      if (DTWorker.this.isRF) {
        currPredictIndex=nodeIndexes.get(entry.getValue().getTreeId());
      }
      if (DTWorker.this.isGBDT) {
        currPredictIndex=nodeIndexes.get(0);
      }
      if (todoNode.getId() == currPredictIndex) {
        List<Integer> features=entry.getValue().getFeatures();
        if (features.isEmpty()) {
          features=getAllValidFeatures();
        }
        for (        Integer columnNum : features) {
          double[] featuerStatistic=localStatistics.get(entry.getKey()).getFeatureStatistics().get(columnNum);
          float weight=data.subsampleWeights[treeId % data.subsampleWeights.length];
          if (Float.compare(weight,0f) != 0) {
            short binIndex=data.inputs[DTWorker.this.inputIndexMap.get(columnNum)];
            DTWorker.this.impurity.featureUpdate(featuerStatistic,binIndex,data.output,data.significance,weight);
          }
        }
      }
    }
  }
  return localStatistics;
}