Program: 20198
Project: 20198
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));
        ParallelTopicModel lda=(ParallelTopicModel)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());
}

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));
        ParallelTopicModel lda=(ParallelTopicModel)ois.readObject();
        features=FeatureConstraintUtil.selectTopLDAFeatures(numConstraints.value,lda,list.getDataAlphabet());
      }
 catch (      Exception e) {
        e.printStackTrace();
      }
    }
 else {
      throw new RuntimeException("String_Node_Str" + featureSelection.value);
    }
  }
  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);
    }
  }
 else   if (targets.value.equals("String_Node_Str")) {
    constraints=FeatureConstraintUtil.setTargetsUsingData(list,features);
  }
 else {
    if (featuresAndLabels == null) {
      featuresAndLabels=FeatureConstraintUtil.labelFeatures(list,features);
      for (      int fi : featuresAndLabels.keySet()) {
        System.err.print(list.getDataAlphabet().lookupObject(fi) + "String_Node_Str");
        for (        int li : featuresAndLabels.get(fi)) {
          System.err.println(list.getTargetAlphabet().lookupObject(li) + "String_Node_Str");
        }
      }
    }
    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);
    }
 else {
      throw new RuntimeException("String_Node_Str" + targets.value);
    }
  }
  writeConstraints(constraints,constraintsFile.value,list.getDataAlphabet(),list.getTargetAlphabet());
}