Program: 106086
Project: 106086
Buggy source:
public static void main(String[] args){
  Set<Class<?>> cmdClasses=ReflectUtil.getClassesWithAnnotation(APICommand.class,new String[]{"String_Node_Str","String_Node_Str"});
  for (  Class<?> cmdClass : cmdClasses) {
    String apiName=cmdClass.getAnnotation(APICommand.class).name();
    if (_apiNameCmdClassMap.containsKey(apiName)) {
      System.out.println("String_Node_Str" + cmdClass.getName() + "String_Node_Str"+ apiName);
      continue;
    }
    _apiNameCmdClassMap.put(apiName,cmdClass);
  }
  LinkedProperties preProcessedCommands=new LinkedProperties();
  String[] fileNames=null;
  List<String> argsList=Arrays.asList(args);
  Iterator<String> iter=argsList.iterator();
  while (iter.hasNext()) {
    String arg=iter.next();
    if (arg.equals("String_Node_Str")) {
      fileNames=iter.next().split("String_Node_Str");
    }
    if (arg.equals("String_Node_Str")) {
      dirName=iter.next();
    }
  }
  if ((fileNames == null) || (fileNames.length == 0)) {
    System.out.println("String_Node_Str");
    System.exit(2);
  }
  for (  String fileName : fileNames) {
    try {
      FileInputStream in=new FileInputStream(fileName);
      preProcessedCommands.load(in);
    }
 catch (    FileNotFoundException ex) {
      System.out.println("String_Node_Str" + fileName);
      System.exit(2);
    }
catch (    IOException ex1) {
      System.out.println("String_Node_Str" + ex1);
      System.exit(2);
    }
  }
  Iterator<?> propertiesIterator=preProcessedCommands.keys.iterator();
  while (propertiesIterator.hasNext()) {
    String key=(String)propertiesIterator.next();
    String preProcessedCommand=preProcessedCommands.getProperty(key);
    int splitIndex=preProcessedCommand.lastIndexOf("String_Node_Str");
    String commandRoleMask=preProcessedCommand.substring(splitIndex + 1);
    Class<?> cmdClass=_apiNameCmdClassMap.get(key);
    if (cmdClass == null) {
      System.out.println("String_Node_Str" + key + "String_Node_Str"+ preProcessedCommand);
      continue;
    }
    String commandName=cmdClass.getName();
    all_api_commands.put(key,commandName);
    short cmdPermissions=1;
    if (commandRoleMask != null) {
      cmdPermissions=Short.parseShort(commandRoleMask);
    }
    if ((cmdPermissions & DOMAIN_ADMIN_COMMAND) != 0) {
      domain_admin_api_commands.put(key,commandName);
    }
    if ((cmdPermissions & USER_COMMAND) != 0) {
      regular_user_api_commands.put(key,commandName);
    }
  }
  all_api_commands.put("String_Node_Str","String_Node_Str");
  domain_admin_api_commands.put("String_Node_Str","String_Node_Str");
  regular_user_api_commands.put("String_Node_Str","String_Node_Str");
  all_api_commands.put("String_Node_Str","String_Node_Str");
  domain_admin_api_commands.put("String_Node_Str","String_Node_Str");
  regular_user_api_commands.put("String_Node_Str","String_Node_Str");
  all_api_commands_sorted.putAll(all_api_commands);
  domain_admin_api_commands_sorted.putAll(domain_admin_api_commands);
  regular_user_api_commands_sorted.putAll(regular_user_api_commands);
  try {
    XStream xs=new XStream();
    xs.alias("String_Node_Str",Command.class);
    xs.alias("String_Node_Str",Argument.class);
    String xmlDocDir=dirName + "String_Node_Str";
    String rootAdminDirName=xmlDocDir + "String_Node_Str";
    String domainAdminDirName=xmlDocDir + "String_Node_Str";
    String regularUserDirName=xmlDocDir + "String_Node_Str";
    (new File(rootAdminDirName)).mkdirs();
    (new File(domainAdminDirName)).mkdirs();
    (new File(regularUserDirName)).mkdirs();
    ObjectOutputStream out=xs.createObjectOutputStream(new FileWriter(dirName + "String_Node_Str"),"String_Node_Str");
    ObjectOutputStream rootAdmin=xs.createObjectOutputStream(new FileWriter(rootAdminDirName + "String_Node_Str" + "String_Node_Str"),"String_Node_Str");
    ObjectOutputStream rootAdminSorted=xs.createObjectOutputStream(new FileWriter(rootAdminDirName + "String_Node_Str" + "String_Node_Str"),"String_Node_Str");
    ObjectOutputStream domainAdmin=xs.createObjectOutputStream(new FileWriter(domainAdminDirName + "String_Node_Str" + "String_Node_Str"),"String_Node_Str");
    ObjectOutputStream outDomainAdminSorted=xs.createObjectOutputStream(new FileWriter(domainAdminDirName + "String_Node_Str" + "String_Node_Str"),"String_Node_Str");
    ObjectOutputStream regularUser=xs.createObjectOutputStream(new FileWriter(regularUserDirName + "String_Node_Str"),"String_Node_Str");
    ObjectOutputStream regularUserSorted=xs.createObjectOutputStream(new FileWriter(regularUserDirName + "String_Node_Str"),"String_Node_Str");
    Iterator<?> it=all_api_commands.keySet().iterator();
    while (it.hasNext()) {
      String key=(String)it.next();
      if (key.equals("String_Node_Str")) {
        writeLoginCommand(out);
        writeLoginCommand(rootAdmin);
        writeLoginCommand(domainAdmin);
        writeLoginCommand(regularUser);
        ObjectOutputStream singleRootAdminCommandOs=xs.createObjectOutputStream(new FileWriter(rootAdminDirName + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"),"String_Node_Str");
        writeLoginCommand(singleRootAdminCommandOs);
        singleRootAdminCommandOs.close();
        ObjectOutputStream singleDomainAdminCommandOs=xs.createObjectOutputStream(new FileWriter(domainAdminDirName + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"),"String_Node_Str");
        writeLoginCommand(singleDomainAdminCommandOs);
        singleDomainAdminCommandOs.close();
        ObjectOutputStream singleRegularUserCommandOs=xs.createObjectOutputStream(new FileWriter(regularUserDirName + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"),"String_Node_Str");
        writeLoginCommand(singleRegularUserCommandOs);
        singleRegularUserCommandOs.close();
      }
 else       if (key.equals("String_Node_Str")) {
        writeLogoutCommand(out);
        writeLogoutCommand(rootAdmin);
        writeLogoutCommand(domainAdmin);
        writeLogoutCommand(regularUser);
        ObjectOutputStream singleRootAdminCommandOs=xs.createObjectOutputStream(new FileWriter(rootAdminDirName + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"),"String_Node_Str");
        writeLogoutCommand(singleRootAdminCommandOs);
        singleRootAdminCommandOs.close();
        ObjectOutputStream singleDomainAdminCommandOs=xs.createObjectOutputStream(new FileWriter(domainAdminDirName + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"),"String_Node_Str");
        writeLogoutCommand(singleDomainAdminCommandOs);
        singleDomainAdminCommandOs.close();
        ObjectOutputStream singleRegularUserCommandOs=xs.createObjectOutputStream(new FileWriter(regularUserDirName + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"),"String_Node_Str");
        writeLogoutCommand(singleRegularUserCommandOs);
        singleRegularUserCommandOs.close();
      }
 else {
        writeCommand(out,key);
        writeCommand(rootAdmin,key);
        if (!key.equals("String_Node_Str")) {
          ObjectOutputStream singleRootAdminCommandOs=xs.createObjectOutputStream(new FileWriter(rootAdminDirName + "String_Node_Str" + key+ "String_Node_Str"),"String_Node_Str");
          writeCommand(singleRootAdminCommandOs,key);
          singleRootAdminCommandOs.close();
        }
        if (domain_admin_api_commands.containsKey(key)) {
          writeCommand(domainAdmin,key);
          ObjectOutputStream singleDomainAdminCommandOs=xs.createObjectOutputStream(new FileWriter(domainAdminDirName + "String_Node_Str" + key+ "String_Node_Str"),"String_Node_Str");
          writeCommand(singleDomainAdminCommandOs,key);
          singleDomainAdminCommandOs.close();
        }
        if (regular_user_api_commands.containsKey(key)) {
          writeCommand(regularUser,key);
          ObjectOutputStream singleRegularUserCommandOs=xs.createObjectOutputStream(new FileWriter(regularUserDirName + "String_Node_Str" + key+ "String_Node_Str"),"String_Node_Str");
          writeCommand(singleRegularUserCommandOs,key);
          singleRegularUserCommandOs.close();
        }
      }
    }
    it=all_api_commands_sorted.keySet().iterator();
    while (it.hasNext()) {
      String key=(String)it.next();
      if (key.equals("String_Node_Str")) {
        writeLoginCommand(rootAdminSorted);
        writeLoginCommand(outDomainAdminSorted);
        writeLoginCommand(regularUserSorted);
      }
 else       if (key.equals("String_Node_Str")) {
        writeLogoutCommand(rootAdminSorted);
        writeLogoutCommand(outDomainAdminSorted);
        writeLogoutCommand(regularUserSorted);
      }
 else {
        writeCommand(rootAdminSorted,key);
        if (domain_admin_api_commands.containsKey(key)) {
          writeCommand(outDomainAdminSorted,key);
        }
        if (regular_user_api_commands.containsKey(key)) {
          writeCommand(regularUserSorted,key);
        }
      }
    }
    out.close();
    rootAdmin.close();
    rootAdminSorted.close();
    domainAdmin.close();
    outDomainAdminSorted.close();
    regularUser.close();
    regularUserSorted.close();
    writeAlertTypes(xmlDocDir);
  }
 catch (  Exception ex) {
    ex.printStackTrace();
    System.exit(2);
  }
}

Fixed version (ground truth):
public static void main(String[] args){
  Set<Class<?>> cmdClasses=ReflectUtil.getClassesWithAnnotation(APICommand.class,new String[]{"String_Node_Str","String_Node_Str"});
  for (  Class<?> cmdClass : cmdClasses) {
    String apiName=cmdClass.getAnnotation(APICommand.class).name();
    if (_apiNameCmdClassMap.containsKey(apiName)) {
      System.out.println("String_Node_Str" + cmdClass.getName() + "String_Node_Str"+ apiName);
      continue;
    }
    _apiNameCmdClassMap.put(apiName,cmdClass);
  }
  LinkedProperties preProcessedCommands=new LinkedProperties();
  String[] fileNames=null;
  List<String> argsList=Arrays.asList(args);
  Iterator<String> iter=argsList.iterator();
  while (iter.hasNext()) {
    String arg=iter.next();
    if (arg.equals("String_Node_Str")) {
      fileNames=iter.next().split("String_Node_Str");
    }
    if (arg.equals("String_Node_Str")) {
      dirName=iter.next();
    }
  }
  if ((fileNames == null) || (fileNames.length == 0)) {
    System.out.println("String_Node_Str");
    System.exit(2);
  }
  for (  String fileName : fileNames) {
    try {
      FileInputStream in=new FileInputStream(fileName);
      preProcessedCommands.load(in);
      in.close();
    }
 catch (    FileNotFoundException ex) {
      System.out.println("String_Node_Str" + fileName);
      System.exit(2);
    }
catch (    IOException ex1) {
      System.out.println("String_Node_Str" + ex1);
      System.exit(2);
    }
  }
  Iterator<?> propertiesIterator=preProcessedCommands.keys.iterator();
  while (propertiesIterator.hasNext()) {
    String key=(String)propertiesIterator.next();
    String preProcessedCommand=preProcessedCommands.getProperty(key);
    int splitIndex=preProcessedCommand.lastIndexOf("String_Node_Str");
    String commandRoleMask=preProcessedCommand.substring(splitIndex + 1);
    Class<?> cmdClass=_apiNameCmdClassMap.get(key);
    if (cmdClass == null) {
      System.out.println("String_Node_Str" + key + "String_Node_Str"+ preProcessedCommand);
      continue;
    }
    String commandName=cmdClass.getName();
    all_api_commands.put(key,commandName);
    short cmdPermissions=1;
    if (commandRoleMask != null) {
      cmdPermissions=Short.parseShort(commandRoleMask);
    }
    if ((cmdPermissions & DOMAIN_ADMIN_COMMAND) != 0) {
      domain_admin_api_commands.put(key,commandName);
    }
    if ((cmdPermissions & USER_COMMAND) != 0) {
      regular_user_api_commands.put(key,commandName);
    }
  }
  all_api_commands.put("String_Node_Str","String_Node_Str");
  domain_admin_api_commands.put("String_Node_Str","String_Node_Str");
  regular_user_api_commands.put("String_Node_Str","String_Node_Str");
  all_api_commands.put("String_Node_Str","String_Node_Str");
  domain_admin_api_commands.put("String_Node_Str","String_Node_Str");
  regular_user_api_commands.put("String_Node_Str","String_Node_Str");
  all_api_commands_sorted.putAll(all_api_commands);
  domain_admin_api_commands_sorted.putAll(domain_admin_api_commands);
  regular_user_api_commands_sorted.putAll(regular_user_api_commands);
  try {
    XStream xs=new XStream();
    xs.alias("String_Node_Str",Command.class);
    xs.alias("String_Node_Str",Argument.class);
    String xmlDocDir=dirName + "String_Node_Str";
    String rootAdminDirName=xmlDocDir + "String_Node_Str";
    String domainAdminDirName=xmlDocDir + "String_Node_Str";
    String regularUserDirName=xmlDocDir + "String_Node_Str";
    (new File(rootAdminDirName)).mkdirs();
    (new File(domainAdminDirName)).mkdirs();
    (new File(regularUserDirName)).mkdirs();
    ObjectOutputStream out=xs.createObjectOutputStream(new FileWriter(dirName + "String_Node_Str"),"String_Node_Str");
    ObjectOutputStream rootAdmin=xs.createObjectOutputStream(new FileWriter(rootAdminDirName + "String_Node_Str" + "String_Node_Str"),"String_Node_Str");
    ObjectOutputStream rootAdminSorted=xs.createObjectOutputStream(new FileWriter(rootAdminDirName + "String_Node_Str" + "String_Node_Str"),"String_Node_Str");
    ObjectOutputStream domainAdmin=xs.createObjectOutputStream(new FileWriter(domainAdminDirName + "String_Node_Str" + "String_Node_Str"),"String_Node_Str");
    ObjectOutputStream outDomainAdminSorted=xs.createObjectOutputStream(new FileWriter(domainAdminDirName + "String_Node_Str" + "String_Node_Str"),"String_Node_Str");
    ObjectOutputStream regularUser=xs.createObjectOutputStream(new FileWriter(regularUserDirName + "String_Node_Str"),"String_Node_Str");
    ObjectOutputStream regularUserSorted=xs.createObjectOutputStream(new FileWriter(regularUserDirName + "String_Node_Str"),"String_Node_Str");
    Iterator<?> it=all_api_commands.keySet().iterator();
    while (it.hasNext()) {
      String key=(String)it.next();
      if (key.equals("String_Node_Str")) {
        writeLoginCommand(out);
        writeLoginCommand(rootAdmin);
        writeLoginCommand(domainAdmin);
        writeLoginCommand(regularUser);
        ObjectOutputStream singleRootAdminCommandOs=xs.createObjectOutputStream(new FileWriter(rootAdminDirName + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"),"String_Node_Str");
        writeLoginCommand(singleRootAdminCommandOs);
        singleRootAdminCommandOs.close();
        ObjectOutputStream singleDomainAdminCommandOs=xs.createObjectOutputStream(new FileWriter(domainAdminDirName + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"),"String_Node_Str");
        writeLoginCommand(singleDomainAdminCommandOs);
        singleDomainAdminCommandOs.close();
        ObjectOutputStream singleRegularUserCommandOs=xs.createObjectOutputStream(new FileWriter(regularUserDirName + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"),"String_Node_Str");
        writeLoginCommand(singleRegularUserCommandOs);
        singleRegularUserCommandOs.close();
      }
 else       if (key.equals("String_Node_Str")) {
        writeLogoutCommand(out);
        writeLogoutCommand(rootAdmin);
        writeLogoutCommand(domainAdmin);
        writeLogoutCommand(regularUser);
        ObjectOutputStream singleRootAdminCommandOs=xs.createObjectOutputStream(new FileWriter(rootAdminDirName + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"),"String_Node_Str");
        writeLogoutCommand(singleRootAdminCommandOs);
        singleRootAdminCommandOs.close();
        ObjectOutputStream singleDomainAdminCommandOs=xs.createObjectOutputStream(new FileWriter(domainAdminDirName + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"),"String_Node_Str");
        writeLogoutCommand(singleDomainAdminCommandOs);
        singleDomainAdminCommandOs.close();
        ObjectOutputStream singleRegularUserCommandOs=xs.createObjectOutputStream(new FileWriter(regularUserDirName + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"),"String_Node_Str");
        writeLogoutCommand(singleRegularUserCommandOs);
        singleRegularUserCommandOs.close();
      }
 else {
        writeCommand(out,key);
        writeCommand(rootAdmin,key);
        if (!key.equals("String_Node_Str")) {
          ObjectOutputStream singleRootAdminCommandOs=xs.createObjectOutputStream(new FileWriter(rootAdminDirName + "String_Node_Str" + key+ "String_Node_Str"),"String_Node_Str");
          writeCommand(singleRootAdminCommandOs,key);
          singleRootAdminCommandOs.close();
        }
        if (domain_admin_api_commands.containsKey(key)) {
          writeCommand(domainAdmin,key);
          ObjectOutputStream singleDomainAdminCommandOs=xs.createObjectOutputStream(new FileWriter(domainAdminDirName + "String_Node_Str" + key+ "String_Node_Str"),"String_Node_Str");
          writeCommand(singleDomainAdminCommandOs,key);
          singleDomainAdminCommandOs.close();
        }
        if (regular_user_api_commands.containsKey(key)) {
          writeCommand(regularUser,key);
          ObjectOutputStream singleRegularUserCommandOs=xs.createObjectOutputStream(new FileWriter(regularUserDirName + "String_Node_Str" + key+ "String_Node_Str"),"String_Node_Str");
          writeCommand(singleRegularUserCommandOs,key);
          singleRegularUserCommandOs.close();
        }
      }
    }
    it=all_api_commands_sorted.keySet().iterator();
    while (it.hasNext()) {
      String key=(String)it.next();
      if (key.equals("String_Node_Str")) {
        writeLoginCommand(rootAdminSorted);
        writeLoginCommand(outDomainAdminSorted);
        writeLoginCommand(regularUserSorted);
      }
 else       if (key.equals("String_Node_Str")) {
        writeLogoutCommand(rootAdminSorted);
        writeLogoutCommand(outDomainAdminSorted);
        writeLogoutCommand(regularUserSorted);
      }
 else {
        writeCommand(rootAdminSorted,key);
        if (domain_admin_api_commands.containsKey(key)) {
          writeCommand(outDomainAdminSorted,key);
        }
        if (regular_user_api_commands.containsKey(key)) {
          writeCommand(regularUserSorted,key);
        }
      }
    }
    out.close();
    rootAdmin.close();
    rootAdminSorted.close();
    domainAdmin.close();
    outDomainAdminSorted.close();
    regularUser.close();
    regularUserSorted.close();
    writeAlertTypes(xmlDocDir);
  }
 catch (  Exception ex) {
    ex.printStackTrace();
    System.exit(2);
  }
}