Program: 28859
Project: 28859
Buggy source:
/** 
 * The main program for the bootstrap.
 * @param args Command line arguments to be processed
 */
public static void main(String args[]){
  if (catalinaHome == null) {
    log.log(Level.SEVERE,MUST_SET_SYS_PROPERTY);
    System.exit(1);
  }
  int index=0;
  while (true) {
    if (index == args.length) {
      usage();
      System.exit(1);
    }
    if ("String_Node_Str".equals(args[index]))     ant=true;
 else     if ("String_Node_Str".equals(args[index]))     common=true;
 else     if ("String_Node_Str".equals(args[index]))     debug=true;
 else     if ("String_Node_Str".equals(args[index]))     server=true;
 else     if ("String_Node_Str".equals(args[index]))     shared=true;
 else     break;
    index++;
  }
  if (index > args.length) {
    usage();
    System.exit(1);
  }
  if (ant)   System.setProperty("String_Node_Str",catalinaHome);
  ClassLoader classLoader=null;
  try {
    if (log.isLoggable(Level.FINE)) {
      log.log(Level.FINE,"String_Node_Str");
      ClassLoaderFactory.setDebug(1);
    }
    ArrayList<File> packed=new ArrayList<File>();
    ArrayList<File> unpacked=new ArrayList<File>();
    unpacked.add(new File(catalinaHome,"String_Node_Str"));
    packed.add(new File(catalinaHome,"String_Node_Str"));
    if (common) {
      unpacked.add(new File(catalinaHome,"String_Node_Str" + File.separator + "String_Node_Str"));
      packed.add(new File(catalinaHome,"String_Node_Str" + File.separator + "String_Node_Str"));
    }
    if (server) {
      unpacked.add(new File(catalinaHome,"String_Node_Str" + File.separator + "String_Node_Str"));
      packed.add(new File(catalinaHome,"String_Node_Str" + File.separator + "String_Node_Str"));
    }
    if (shared) {
      unpacked.add(new File(catalinaHome,"String_Node_Str" + File.separator + "String_Node_Str"));
      packed.add(new File(catalinaHome,"String_Node_Str" + File.separator + "String_Node_Str"));
    }
    classLoader=ClassLoaderFactory.createClassLoader(unpacked.toArray(new File[unpacked.size()]),packed.toArray(new File[packed.size()]),null);
  }
 catch (  Throwable t) {
    log.log(Level.SEVERE,CLASS_LOADER_CREATION_EXCEPTION,t);
    System.exit(1);
  }
  Thread.currentThread().setContextClassLoader(classLoader);
  Class<?> clazz=null;
  String className=args[index++];
  try {
    if (log.isLoggable(Level.FINE))     log.log(Level.FINE,"String_Node_Str" + className);
    clazz=classLoader.loadClass(className);
  }
 catch (  Throwable t) {
    String msg=MessageFormat.format(rb.getString(CREATING_INSTANCE_EXCEPTION),className);
    log.log(Level.SEVERE,msg,t);
    System.exit(1);
  }
  Method method=null;
  String params[]=new String[args.length - index];
  System.arraycopy(args,index,params,0,params.length);
  try {
    if (log.isLoggable(Level.FINE))     log.log(Level.FINE,"String_Node_Str");
    String methodName="String_Node_Str";
    Class paramTypes[]=new Class[1];
    paramTypes[0]=params.getClass();
    method=clazz.getMethod(methodName,paramTypes);
  }
 catch (  Throwable t) {
    log.log(Level.SEVERE,LOCATING_MAIN_METHOD_EXCEPTION,t);
    System.exit(1);
  }
  try {
    if (log.isLoggable(Level.FINE))     log.log(Level.FINE,"String_Node_Str");
    Object paramValues[]=new Object[1];
    paramValues[0]=params;
    method.invoke(null,paramValues);
  }
 catch (  Throwable t) {
    log.log(Level.SEVERE,CALLING_MAIN_METHOD_EXCEPTION,t);
    System.exit(1);
  }
}

Fixed version (ground truth):
/** 
 * The main program for the bootstrap.
 * @param args Command line arguments to be processed
 */
public static void main(String args[]){
  if (catalinaHome == null) {
    log.log(Level.SEVERE,MUST_SET_SYS_PROPERTY);
    System.exit(1);
  }
  int index=0;
  while (true) {
    if (index == args.length) {
      usage();
      System.exit(1);
    }
    if ("String_Node_Str".equals(args[index]))     ant=true;
 else     if ("String_Node_Str".equals(args[index]))     common=true;
 else     if ("String_Node_Str".equals(args[index]))     server=true;
 else     if ("String_Node_Str".equals(args[index]))     shared=true;
 else     break;
    index++;
  }
  if (index > args.length) {
    usage();
    System.exit(1);
  }
  if (ant)   System.setProperty("String_Node_Str",catalinaHome);
  ClassLoader classLoader=null;
  try {
    if (log.isLoggable(Level.FINE)) {
      log.log(Level.FINE,"String_Node_Str");
      ClassLoaderFactory.setDebug(1);
    }
    ArrayList<File> packed=new ArrayList<File>();
    ArrayList<File> unpacked=new ArrayList<File>();
    unpacked.add(new File(catalinaHome,"String_Node_Str"));
    packed.add(new File(catalinaHome,"String_Node_Str"));
    if (common) {
      unpacked.add(new File(catalinaHome,"String_Node_Str" + File.separator + "String_Node_Str"));
      packed.add(new File(catalinaHome,"String_Node_Str" + File.separator + "String_Node_Str"));
    }
    if (server) {
      unpacked.add(new File(catalinaHome,"String_Node_Str" + File.separator + "String_Node_Str"));
      packed.add(new File(catalinaHome,"String_Node_Str" + File.separator + "String_Node_Str"));
    }
    if (shared) {
      unpacked.add(new File(catalinaHome,"String_Node_Str" + File.separator + "String_Node_Str"));
      packed.add(new File(catalinaHome,"String_Node_Str" + File.separator + "String_Node_Str"));
    }
    classLoader=ClassLoaderFactory.createClassLoader(unpacked.toArray(new File[unpacked.size()]),packed.toArray(new File[packed.size()]),null);
  }
 catch (  Throwable t) {
    log.log(Level.SEVERE,CLASS_LOADER_CREATION_EXCEPTION,t);
    System.exit(1);
  }
  Thread.currentThread().setContextClassLoader(classLoader);
  Class<?> clazz=null;
  String className=args[index++];
  try {
    if (log.isLoggable(Level.FINE))     log.log(Level.FINE,"String_Node_Str" + className);
    clazz=classLoader.loadClass(className);
  }
 catch (  Throwable t) {
    String msg=MessageFormat.format(rb.getString(CREATING_INSTANCE_EXCEPTION),className);
    log.log(Level.SEVERE,msg,t);
    System.exit(1);
  }
  Method method=null;
  String params[]=new String[args.length - index];
  System.arraycopy(args,index,params,0,params.length);
  try {
    if (log.isLoggable(Level.FINE))     log.log(Level.FINE,"String_Node_Str");
    String methodName="String_Node_Str";
    Class paramTypes[]=new Class[1];
    paramTypes[0]=params.getClass();
    method=clazz.getMethod(methodName,paramTypes);
  }
 catch (  Throwable t) {
    log.log(Level.SEVERE,LOCATING_MAIN_METHOD_EXCEPTION,t);
    System.exit(1);
  }
  try {
    if (log.isLoggable(Level.FINE))     log.log(Level.FINE,"String_Node_Str");
    Object paramValues[]=new Object[1];
    paramValues[0]=params;
    method.invoke(null,paramValues);
  }
 catch (  Throwable t) {
    log.log(Level.SEVERE,CALLING_MAIN_METHOD_EXCEPTION,t);
    System.exit(1);
  }
}