Program: 20200
Project: 20200
Buggy source:
public static void main(String[] args){
  CommandOption.process(Vectors2FeatureConstraints.class,args);
  InstanceList list=InstanceList.load(vectorsFile.value);
  ArrayList<Integer> features=null;
  HashMap<Integer,ArrayList<Integer>> featuresAndLabels=null;
  if (featuresFile.wasInvoked()) {
    if (fileContainsLabels(featuresFile.value)) {
      featuresAndLabels=readFeaturesAndLabelsFromFile(featuresFile.value,list.getDataAlphabet(),list.getTargetAlphabet());
    }
 else {
      features=readFeaturesFromFile(featuresFile.value,list.getDataAlphabet());
    }
  }
 else {
    if (featureSelection.value.equals("String_Node_Str")) {
      features=FeatureConstraintUtil.selectFeaturesByInfoGain(list,numConstraints.value);
    }
 else     if (featureSelection.value.equals("String_Node_Str")) {
      try {
        ObjectInputStream ois=new ObjectInputStream(new FileInputStream(ldaFile.value));
        LDAHyper lda=(LDAHyper)ois.readObject();
        features=FeatureConstraintUtil.selectTopLDAFeatures(numConstraints.value,lda,list.getDataAlphabet());
      }
 catch (      Exception e) {
        e.printStackTrace();
      }
    }
  }
  HashMap<Integer,double[]> constraints=null;
  if (targets.value.equals("String_Node_Str")) {
    constraints=new HashMap<Integer,double[]>();
    for (    int fi : features) {
      constraints.put(fi,null);
    }
  }
  if (targets.value.equals("String_Node_Str")) {
    constraints=FeatureConstraintUtil.setTargetsUsingData(list,features);
  }
 else {
    if (featuresAndLabels == null) {
      FeatureConstraintUtil.labelFeatures(list,features);
    }
    if (targets.value.equals("String_Node_Str")) {
      constraints=FeatureConstraintUtil.setTargetsUsingHeuristic(featuresAndLabels,list.getTargetAlphabet().size(),majorityProb.value);
    }
 else     if (targets.value.equals("String_Node_Str")) {
      constraints=FeatureConstraintUtil.setTargetsUsingFeatureVoting(featuresAndLabels,list);
    }
  }
  writeConstraints(constraints,constraintsFile.value,list.getDataAlphabet(),list.getTargetAlphabet());
}

Fixed version (ground truth):
public static void main(String[] args){
  CommandOption.process(Vectors2FeatureConstraints.class,args);
  InstanceList list=InstanceList.load(vectorsFile.value);
  ArrayList<Integer> features=null;
  HashMap<Integer,ArrayList<Integer>> featuresAndLabels=null;
  if (featuresFile.wasInvoked()) {
    if (fileContainsLabels(featuresFile.value)) {
      featuresAndLabels=readFeaturesAndLabelsFromFile(featuresFile.value,list.getDataAlphabet(),list.getTargetAlphabet());
    }
 else {
      features=readFeaturesFromFile(featuresFile.value,list.getDataAlphabet());
    }
  }
 else {
    if (featureSelection.value.equals("String_Node_Str")) {
      features=FeatureConstraintUtil.selectFeaturesByInfoGain(list,numConstraints.value);
    }
 else     if (featureSelection.value.equals("String_Node_Str")) {
      try {
        ObjectInputStream ois=new ObjectInputStream(new FileInputStream(ldaFile.value));
        LDAHyper lda=(LDAHyper)ois.readObject();
        features=FeatureConstraintUtil.selectTopLDAFeatures(numConstraints.value,lda,list.getDataAlphabet());
      }
 catch (      Exception e) {
        e.printStackTrace();
      }
    }
  }
  HashMap<Integer,double[]> constraints=null;
  if (targets.value.equals("String_Node_Str")) {
    constraints=new HashMap<Integer,double[]>();
    for (    int fi : features) {
      constraints.put(fi,null);
    }
  }
  if (targets.value.equals("String_Node_Str")) {
    constraints=FeatureConstraintUtil.setTargetsUsingData(list,features);
  }
 else {
    if (featuresAndLabels == null) {
      featuresAndLabels=FeatureConstraintUtil.labelFeatures(list,features);
    }
    if (targets.value.equals("String_Node_Str")) {
      constraints=FeatureConstraintUtil.setTargetsUsingHeuristic(featuresAndLabels,list.getTargetAlphabet().size(),majorityProb.value);
    }
 else     if (targets.value.equals("String_Node_Str")) {
      constraints=FeatureConstraintUtil.setTargetsUsingFeatureVoting(featuresAndLabels,list);
    }
  }
  writeConstraints(constraints,constraintsFile.value,list.getDataAlphabet(),list.getTargetAlphabet());
}