Program: 26184
Project: 26184
Buggy source:
/** 
 * Builds the difference of the given configurations and emits the results.
 * @param configs The list of given configurations.
 * @throws IOException When emitting the results fails.
 */
public void diff(ArrayList<Configuration> configs) throws IOException {
  if (!quiet) {
    System.out.println("String_Node_Str");
    System.out.println("String_Node_Str");
    System.out.println("String_Node_Str");
  }
  MergedConfiguration mc=new MergedConfiguration();
  TreeSet<String> prevKeys=null;
  Configuration prevConf=null;
  if (!quiet)   System.out.println("String_Node_Str");
  for (  Configuration conf : configs) {
    TreeSet<String> keys=new TreeSet<String>();
    for (    Property p : conf.getProperties()) {
      mc.addProperty(p);
      keys.add(p.getKey());
    }
    String currentVersion=conf.getProperties().first().getSource();
    if (prevKeys != null) {
      TreeSet<String> addedKeys=new TreeSet<String>(keys);
      addedKeys.removeAll(prevKeys);
      if (addedKeys.size() > 0) {
        if (!quiet)         System.out.println("String_Node_Str" + currentVersion + "String_Node_Str");
        for (        String key : addedKeys) {
          Property p=conf.getProperty(key);
          Property p2=prevConf.getPropertyByDescription(p.getDescription());
          boolean renamed=!Property.NULL.equals(p.getDescription()) && p2 != null;
          printProperty(p,p2,renamed ? Action.Renamed : Action.Added);
        }
        System.out.println();
      }
      TreeSet<String> removedKeys=new TreeSet<String>(prevKeys);
      removedKeys.removeAll(keys);
      if (removedKeys.size() > 0) {
        System.out.println("String_Node_Str" + currentVersion + "String_Node_Str");
        for (        String key : removedKeys) {
          Property p=prevConf.getProperty(key);
          printProperty(p,null,Action.Removed);
        }
        System.out.println();
      }
    }
    prevKeys=keys;
    prevConf=conf;
  }
  if (!quiet)   System.out.println("String_Node_Str");
  if (!quiet)   System.out.println("String_Node_Str");
  int diffCount=0;
  for (  String key : mc.getProperties().keySet()) {
    TreeSet<Property> merged=mc.getProperties().get(key);
    if (merged.size() > 1) {
      if (!quiet)       System.out.println("String_Node_Str" + key);
      diffCount++;
      for (      Property p : merged) {
        printProperty(p,null,Action.Changed);
      }
      System.out.println();
    }
  }
  if (!quiet)   System.out.println("String_Node_Str" + diffCount + "String_Node_Str");
  if (!quiet)   System.out.println("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Builds the difference of the given configurations and emits the results.
 * @param configs The list of given configurations.
 * @throws IOException When emitting the results fails.
 */
public void diff(ArrayList<Configuration> configs) throws IOException {
  if (!quiet) {
    System.out.println("String_Node_Str");
    System.out.println("String_Node_Str");
    System.out.println("String_Node_Str");
  }
  MergedConfiguration mc=new MergedConfiguration();
  TreeSet<String> prevKeys=null;
  Configuration prevConf=null;
  if (!quiet)   System.out.println("String_Node_Str");
  for (  Configuration conf : configs) {
    TreeSet<String> keys=new TreeSet<String>();
    for (    Property p : conf.getProperties()) {
      mc.addProperty(p);
      keys.add(p.getKey());
    }
    if (conf.getProperties().size() > 0) {
      String currentVersion=conf.getProperties().first().getSource();
      if (prevKeys != null) {
        TreeSet<String> addedKeys=new TreeSet<String>(keys);
        addedKeys.removeAll(prevKeys);
        if (addedKeys.size() > 0) {
          if (!quiet)           System.out.println("String_Node_Str" + currentVersion + "String_Node_Str");
          int addedCount=0, renamedCount=0;
          for (          String key : addedKeys) {
            Property p=conf.getProperty(key);
            Property p2=prevConf.getPropertyByDescription(p.getDescription());
            boolean renamed=!Property.NULL.equals(p.getDescription()) && p2 != null;
            if (renamed)             renamedCount++;
 else             addedCount++;
            printProperty(p,p2,renamed ? Action.Renamed : Action.Added);
          }
          if (!quiet)           System.out.println("String_Node_Str" + currentVersion + "String_Node_Str"+ addedCount+ "String_Node_Str"+ renamedCount+ "String_Node_Str");
          System.out.println();
        }
        TreeSet<String> removedKeys=new TreeSet<String>(prevKeys);
        removedKeys.removeAll(keys);
        if (removedKeys.size() > 0) {
          System.out.println("String_Node_Str" + currentVersion + "String_Node_Str");
          for (          String key : removedKeys) {
            Property p=prevConf.getProperty(key);
            printProperty(p,null,Action.Removed);
          }
          System.out.println();
        }
      }
    }
    prevKeys=keys;
    prevConf=conf;
  }
  if (!quiet)   System.out.println("String_Node_Str");
  if (!quiet)   System.out.println("String_Node_Str");
  int diffCount=0;
  for (  String key : mc.getProperties().keySet()) {
    TreeSet<Property> merged=mc.getProperties().get(key);
    if (merged.size() > 1) {
      if (!quiet)       System.out.println("String_Node_Str" + key);
      diffCount++;
      for (      Property p : merged) {
        printProperty(p,null,Action.Changed);
      }
      System.out.println();
    }
  }
  if (!quiet)   System.out.println("String_Node_Str" + diffCount + "String_Node_Str");
  if (!quiet)   System.out.println("String_Node_Str");
}