Program: 30063
Project: 30063
Buggy source:
/** 
 * Decodes a line from the keyfile.
 * @param encodedLine A line from the keyfile containing user data.
 * @param newGroupSizeMap Groups found in the encodedLine are added tothis map.
 * @returns FileRealmUser Representing the loaded user.
 * @throws IllegalArgumentException Thrown on failure.
 */
private static User decodeUser(String encodedLine,Map newGroupSizeMap) throws IllegalArgumentException {
  StringTokenizer st=new StringTokenizer(encodedLine,FIELD_SEP);
  String algo=algoSHA256;
  String user=null;
  String pwdInfo=null;
  String groupList=null;
  try {
    user=st.nextToken();
    pwdInfo=st.nextToken();
  }
 catch (  Exception e) {
    String msg=sm.getString("String_Node_Str",encodedLine);
    throw new IllegalArgumentException(msg);
  }
  if (st.hasMoreTokens()) {
    groupList=st.nextToken();
  }
  User ud=new User(user);
  if (resetKey.equals(pwdInfo)) {
    ud.setAlgo(resetKey);
  }
 else {
    if (encodedLine.contains(SSHA_TAG)) {
      algo=algoSHA;
    }
    int resultLength=32;
    if (algoSHA.equals(algo)) {
      resultLength=20;
    }
    byte[] hash=new byte[resultLength];
    byte[] salt=SSHA.decode(pwdInfo,hash,algo);
    ud.setHash(hash);
    ud.setSalt(salt);
    ud.setAlgo(algo);
  }
  List<String> membership=new ArrayList<String>();
  if (groupList != null) {
    StringTokenizer gst=new StringTokenizer(groupList,GROUP_SEP);
    while (gst.hasMoreTokens()) {
      String g=gst.nextToken();
      membership.add(g);
      Integer groupSize=(Integer)newGroupSizeMap.get(g);
      newGroupSizeMap.put(g,Integer.valueOf((groupSize != null) ? (groupSize.intValue() + 1) : 1));
    }
  }
  ud.setGroups(membership.toArray(new String[0]));
  return ud;
}

Fixed version (ground truth):
/** 
 * Decodes a line from the keyfile.
 * @param encodedLine A line from the keyfile containing user data.
 * @param newGroupSizeMap Groups found in the encodedLine are added tothis map.
 * @returns FileRealmUser Representing the loaded user.
 * @throws IllegalArgumentException Thrown on failure.
 */
private static User decodeUser(String encodedLine,Map newGroupSizeMap) throws IllegalArgumentException {
  StringTokenizer st=new StringTokenizer(encodedLine,FIELD_SEP);
  String algo=algoSHA256;
  String user=null;
  String pwdInfo=null;
  String groupList=null;
  try {
    user=st.nextToken();
    pwdInfo=st.nextToken();
  }
 catch (  Exception e) {
    String msg=sm.getString("String_Node_Str",encodedLine);
    throw new IllegalArgumentException(msg);
  }
  if (st.hasMoreTokens()) {
    groupList=st.nextToken();
  }
  User ud=new User(user);
  if (resetKey.equals(pwdInfo)) {
    ud.setAlgo(resetKey);
  }
 else {
    if (encodedLine.contains(SSHA_TAG)) {
      algo=algoSHA;
    }
    int resultLength=32;
    if (algoSHA.equals(algo)) {
      resultLength=20;
    }
    byte[] hash=new byte[resultLength];
    byte[] salt=SSHA.decode(pwdInfo,hash,algo);
    ud.setHash(hash);
    ud.setSalt(salt);
    ud.setAlgo(algo);
  }
  List<String> membership=new ArrayList<String>();
  if (groupList != null) {
    StringTokenizer gst=new StringTokenizer(groupList,GROUP_SEP);
    while (gst.hasMoreTokens()) {
      String g=gst.nextToken();
      membership.add(g);
      Integer groupSize=(Integer)newGroupSizeMap.get(g);
      newGroupSizeMap.put(g,Integer.valueOf((groupSize != null) ? (groupSize.intValue() + 1) : 1));
    }
  }
  ud.setGroups(membership.toArray(new String[membership.size()]));
  return ud;
}