Program: 31725
Project: 31725
Buggy source:
public ScoreObject scoreNsData(MLDataPair inputPair,Map<NSColumn,String> rawNsDataMap){
  if (inputPair == null && !this.alg.equalsIgnoreCase(NNConstants.NN_ALG_NAME)) {
    inputPair=CommonUtils.assembleNsDataPair(binCategoryMap,noVarSelect,modelConfig,columnConfigList,rawNsDataMap,cutoff,alg);
  }
  final MLDataPair pair=inputPair;
  List<Callable<MLData>> tasks=new ArrayList<Callable<MLData>>();
  for (  final BasicML model : models) {
    if (model instanceof BasicNetwork) {
      final BasicNetwork network=(BasicNetwork)model;
      final MLDataPair networkPair=CommonUtils.assembleNsDataPair(binCategoryMap,noVarSelect,modelConfig,columnConfigList,rawNsDataMap,cutoff,alg,null);
      tasks.add(new Callable<MLData>(){
        @Override public MLData call() throws Exception {
          return network.compute(networkPair.getInput());
        }
      }
);
    }
 else     if (model instanceof BasicFloatNetwork) {
      final BasicFloatNetwork network=(BasicFloatNetwork)model;
      final MLDataPair networkPair=CommonUtils.assembleNsDataPair(binCategoryMap,noVarSelect,modelConfig,columnConfigList,rawNsDataMap,cutoff,alg,network.getFeatureSet());
      if (network.getFeatureSet().size() != networkPair.getInput().size()) {
        log.error("String_Node_Str" + network.getFeatureSet().size() + "String_Node_Str"+ networkPair.getInput().size());
        continue;
      }
      tasks.add(new Callable<MLData>(){
        @Override public MLData call() throws Exception {
          return network.compute(networkPair.getInput());
        }
      }
);
    }
 else     if (model instanceof SVM) {
      final SVM svm=(SVM)model;
      if (svm.getInputCount() != pair.getInput().size()) {
        log.error("String_Node_Str" + svm.getInputCount() + "String_Node_Str"+ pair.getInput().size());
        continue;
      }
      tasks.add(new Callable<MLData>(){
        @Override public MLData call() throws Exception {
          return svm.compute(pair.getInput());
        }
      }
);
    }
 else     if (model instanceof LR) {
      final LR lr=(LR)model;
      if (lr.getInputCount() != pair.getInput().size()) {
        log.error("String_Node_Str" + lr.getInputCount() + "String_Node_Str"+ pair.getInput().size());
        continue;
      }
      tasks.add(new Callable<MLData>(){
        @Override public MLData call() throws Exception {
          return lr.compute(pair.getInput());
        }
      }
);
    }
 else     if (model instanceof TreeModel) {
      final TreeModel tm=(TreeModel)model;
      if (tm.getInputCount() != pair.getInput().size()) {
        throw new RuntimeException("String_Node_Str" + tm.getInputCount() + "String_Node_Str"+ pair.getInput().size());
      }
      tasks.add(new Callable<MLData>(){
        @Override public MLData call() throws Exception {
          MLData result=tm.compute(pair.getInput());
          return result;
        }
      }
);
    }
 else {
      throw new RuntimeException("String_Node_Str");
    }
  }
  List<Double> scores=new ArrayList<Double>();
  List<Integer> rfTreeSizeList=new ArrayList<Integer>();
  if (CollectionUtils.isNotEmpty(tasks)) {
    List<MLData> modelResults=this.executorManager.submitTasksAndWaitResults(tasks);
    if (CollectionUtils.isEmpty(modelResults) || modelResults.size() != this.models.size()) {
      log.error("String_Node_Str");
      return null;
    }
    for (int i=0; i < this.models.size(); i++) {
      BasicML model=this.models.get(i);
      MLData score=modelResults.get(i);
      if (model instanceof BasicNetwork) {
        if (modelConfig != null && modelConfig.isRegression()) {
          scores.add(toScore(score.getData(0)));
        }
 else         if (modelConfig != null && modelConfig.isClassification() && modelConfig.getTrain().isOneVsAll()) {
          scores.add(toScore(score.getData(0)));
        }
 else {
          double[] outputs=score.getData();
          for (          double d : outputs) {
            scores.add(toScore(d));
          }
        }
      }
 else       if (model instanceof SVM) {
        scores.add(toScore(score.getData(0)));
      }
 else       if (model instanceof LR) {
        scores.add(toScore(score.getData(0)));
      }
 else       if (model instanceof TreeModel) {
        if (modelConfig.isClassification() && !modelConfig.getTrain().isOneVsAll()) {
          double[] scoreArray=score.getData();
          for (          double sc : scoreArray) {
            scores.add(sc);
          }
        }
 else {
          scores.add(toScore(score.getData(0)));
        }
        final TreeModel tm=(TreeModel)model;
        if (!tm.isClassfication() && !tm.isGBDT()) {
          rfTreeSizeList.add(tm.getTrees().size());
        }
      }
 else {
        throw new RuntimeException("String_Node_Str");
      }
    }
  }
  Integer tag=Constants.DEFAULT_IDEAL_VALUE;
  if (scores.size() == 0) {
    log.warn("String_Node_Str");
  }
  return new ScoreObject(scores,tag,rfTreeSizeList);
}

Fixed version (ground truth):
public ScoreObject scoreNsData(MLDataPair inputPair,Map<NSColumn,String> rawNsDataMap){
  if (inputPair == null && !this.alg.equalsIgnoreCase(NNConstants.NN_ALG_NAME)) {
    inputPair=CommonUtils.assembleNsDataPair(binCategoryMap,noVarSelect,modelConfig,columnConfigList,rawNsDataMap,cutoff,alg);
  }
  final MLDataPair pair=inputPair;
  List<Callable<MLData>> tasks=new ArrayList<Callable<MLData>>();
  for (  final BasicML model : models) {
    if (model instanceof BasicFloatNetwork) {
      final BasicFloatNetwork network=(BasicFloatNetwork)model;
      final MLDataPair networkPair=CommonUtils.assembleNsDataPair(binCategoryMap,noVarSelect,modelConfig,columnConfigList,rawNsDataMap,cutoff,alg,network.getFeatureSet());
      if (network.getFeatureSet().size() != networkPair.getInput().size()) {
        log.error("String_Node_Str" + network.getFeatureSet().size() + "String_Node_Str"+ networkPair.getInput().size());
        continue;
      }
      tasks.add(new Callable<MLData>(){
        @Override public MLData call() throws Exception {
          return network.compute(networkPair.getInput());
        }
      }
);
    }
 else     if (model instanceof BasicNetwork) {
      final BasicNetwork network=(BasicNetwork)model;
      final MLDataPair networkPair=CommonUtils.assembleNsDataPair(binCategoryMap,noVarSelect,modelConfig,columnConfigList,rawNsDataMap,cutoff,alg,null);
      tasks.add(new Callable<MLData>(){
        @Override public MLData call() throws Exception {
          return network.compute(networkPair.getInput());
        }
      }
);
    }
 else     if (model instanceof SVM) {
      final SVM svm=(SVM)model;
      if (svm.getInputCount() != pair.getInput().size()) {
        log.error("String_Node_Str" + svm.getInputCount() + "String_Node_Str"+ pair.getInput().size());
        continue;
      }
      tasks.add(new Callable<MLData>(){
        @Override public MLData call() throws Exception {
          return svm.compute(pair.getInput());
        }
      }
);
    }
 else     if (model instanceof LR) {
      final LR lr=(LR)model;
      if (lr.getInputCount() != pair.getInput().size()) {
        log.error("String_Node_Str" + lr.getInputCount() + "String_Node_Str"+ pair.getInput().size());
        continue;
      }
      tasks.add(new Callable<MLData>(){
        @Override public MLData call() throws Exception {
          return lr.compute(pair.getInput());
        }
      }
);
    }
 else     if (model instanceof TreeModel) {
      final TreeModel tm=(TreeModel)model;
      if (tm.getInputCount() != pair.getInput().size()) {
        throw new RuntimeException("String_Node_Str" + tm.getInputCount() + "String_Node_Str"+ pair.getInput().size());
      }
      tasks.add(new Callable<MLData>(){
        @Override public MLData call() throws Exception {
          MLData result=tm.compute(pair.getInput());
          return result;
        }
      }
);
    }
 else {
      throw new RuntimeException("String_Node_Str");
    }
  }
  List<Double> scores=new ArrayList<Double>();
  List<Integer> rfTreeSizeList=new ArrayList<Integer>();
  if (CollectionUtils.isNotEmpty(tasks)) {
    List<MLData> modelResults=this.executorManager.submitTasksAndWaitResults(tasks);
    if (CollectionUtils.isEmpty(modelResults) || modelResults.size() != this.models.size()) {
      log.error("String_Node_Str");
      return null;
    }
    for (int i=0; i < this.models.size(); i++) {
      BasicML model=this.models.get(i);
      MLData score=modelResults.get(i);
      if (model instanceof BasicNetwork) {
        if (modelConfig != null && modelConfig.isRegression()) {
          scores.add(toScore(score.getData(0)));
        }
 else         if (modelConfig != null && modelConfig.isClassification() && modelConfig.getTrain().isOneVsAll()) {
          scores.add(toScore(score.getData(0)));
        }
 else {
          double[] outputs=score.getData();
          for (          double d : outputs) {
            scores.add(toScore(d));
          }
        }
      }
 else       if (model instanceof SVM) {
        scores.add(toScore(score.getData(0)));
      }
 else       if (model instanceof LR) {
        scores.add(toScore(score.getData(0)));
      }
 else       if (model instanceof TreeModel) {
        if (modelConfig.isClassification() && !modelConfig.getTrain().isOneVsAll()) {
          double[] scoreArray=score.getData();
          for (          double sc : scoreArray) {
            scores.add(sc);
          }
        }
 else {
          scores.add(toScore(score.getData(0)));
        }
        final TreeModel tm=(TreeModel)model;
        if (!tm.isClassfication() && !tm.isGBDT()) {
          rfTreeSizeList.add(tm.getTrees().size());
        }
      }
 else {
        throw new RuntimeException("String_Node_Str");
      }
    }
  }
  Integer tag=Constants.DEFAULT_IDEAL_VALUE;
  if (scores.size() == 0) {
    log.warn("String_Node_Str");
  }
  return new ScoreObject(scores,tag,rfTreeSizeList);
}