Program: 61357
Project: 61357
Buggy source:
/** 
 * <p>Reads one line from the input file and adds the data to a   {@link Map} data structure which maps user IDs topreferences. This assumes that each line of the input file corresponds to one preference. After reading a line and determining which user and item the preference pertains to, the method should look to see if the data contains a mapping for the user ID already, and if not, add an empty  {@link List} of {@link Preference}s to the data.</p> <p>Note that if the line is empty or begins with '#' it will be ignored as a comment.</p>
 * @param line      line from input data file
 * @param data      all data read so far, as a mapping from user IDs to preferences
 */
protected void processLine(String line,FastByIDMap<Collection<Preference>> data,char delimiter){
  if (line.length() == 0 || line.charAt(0) == '#') {
    return;
  }
  int delimiterOne=line.indexOf((int)delimiter);
  int delimiterTwo=line.indexOf((int)delimiter,delimiterOne + 1);
  if (delimiterOne < 0 || delimiterTwo < 0) {
    throw new IllegalArgumentException("String_Node_Str" + line);
  }
  long userID=Long.parseLong(line.substring(0,delimiterOne));
  long itemID=Long.parseLong(line.substring(delimiterOne + 1,delimiterTwo));
  String preferenceValueString=line.substring(delimiterTwo + 1);
  if (transpose) {
    long tmp=userID;
    userID=itemID;
    itemID=tmp;
  }
  Collection<Preference> prefs=data.get(userID);
  if (prefs == null) {
    prefs=new ArrayList<Preference>(2);
    data.put(userID,prefs);
  }
  if (preferenceValueString.length() == 0) {
    Iterator<Preference> prefsIterator=prefs.iterator();
    while (prefsIterator.hasNext()) {
      Preference pref=prefsIterator.next();
      if (pref.getItemID() == itemID) {
        prefsIterator.remove();
        break;
      }
    }
  }
 else {
    float preferenceValue=Float.parseFloat(preferenceValueString);
    prefs.add(new GenericPreference(userID,itemID,preferenceValue));
  }
}

Fixed version (ground truth):
/** 
 * <p>Reads one line from the input file and adds the data to a   {@link Map} data structure which maps user IDs topreferences. This assumes that each line of the input file corresponds to one preference. After reading a line and determining which user and item the preference pertains to, the method should look to see if the data contains a mapping for the user ID already, and if not, add an empty  {@link List} of {@link Preference}s to the data.</p> <p>Note that if the line is empty or begins with '#' it will be ignored as a comment.</p>
 * @param line      line from input data file
 * @param data      all data read so far, as a mapping from user IDs to preferences
 */
protected void processLine(String line,FastByIDMap<Collection<Preference>> data,char delimiter){
  if (line.length() == 0 || line.charAt(0) == COMMENT_CHAR) {
    return;
  }
  int delimiterOne=line.indexOf((int)delimiter);
  int delimiterTwo=line.indexOf((int)delimiter,delimiterOne + 1);
  if (delimiterOne < 0 || delimiterTwo < 0) {
    throw new IllegalArgumentException("String_Node_Str" + line);
  }
  long userID=Long.parseLong(line.substring(0,delimiterOne));
  long itemID=Long.parseLong(line.substring(delimiterOne + 1,delimiterTwo));
  String preferenceValueString=line.substring(delimiterTwo + 1);
  if (transpose) {
    long tmp=userID;
    userID=itemID;
    itemID=tmp;
  }
  Collection<Preference> prefs=data.get(userID);
  if (prefs == null) {
    prefs=new ArrayList<Preference>(2);
    data.put(userID,prefs);
  }
  if (preferenceValueString.length() == 0) {
    Iterator<Preference> prefsIterator=prefs.iterator();
    while (prefsIterator.hasNext()) {
      Preference pref=prefsIterator.next();
      if (pref.getItemID() == itemID) {
        prefsIterator.remove();
        break;
      }
    }
  }
 else {
    float preferenceValue=Float.parseFloat(preferenceValueString);
    prefs.add(new GenericPreference(userID,itemID,preferenceValue));
  }
}