Program: 190722
Project: 190722
Buggy source:
/** 
 * Runs the schema generator.
 * @param classLoader the schema generator will run in this classLoader. It needs to be able to load APT and JAXB RI classes. Note that JAXB RI classes refer to APT classes. Must not be null.
 * @return exit code. 0 if success.
 */
public static int run(String[] args,ClassLoader classLoader) throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {
  final Options options=new Options();
  if (args.length == 0) {
    usage();
    return -1;
  }
  for (  String arg : args) {
    if (arg.equals("String_Node_Str")) {
      usage();
      return -1;
    }
    if (arg.equals("String_Node_Str")) {
      System.out.println(Messages.VERSION.format());
      return -1;
    }
  }
  try {
    options.parseArguments(args);
  }
 catch (  BadCommandLineException e) {
    System.out.println(e.getMessage());
    System.out.println();
    usage();
    return -1;
  }
  Class schemagenRunner=classLoader.loadClass(Runner.class.getName());
  Method mainMethod=schemagenRunner.getDeclaredMethod("String_Node_Str",String[].class);
  List<String> aptargs=new ArrayList<String>();
  if (hasClass(options.arguments))   aptargs.add("String_Node_Str");
  if (options.classpath != null) {
    aptargs.add("String_Node_Str");
    aptargs.add(options.classpath);
  }
  if (options.targetDir != null) {
    aptargs.add("String_Node_Str");
    aptargs.add(options.targetDir.getPath());
  }
  aptargs.addAll(options.arguments);
  String[] argsarray=aptargs.toArray(new String[aptargs.size()]);
  return (Integer)mainMethod.invoke(null,new Object[]{argsarray});
}

Fixed version (ground truth):
/** 
 * Runs the schema generator.
 * @param classLoader the schema generator will run in this classLoader. It needs to be able to load APT and JAXB RI classes. Note that JAXB RI classes refer to APT classes. Must not be null.
 * @return exit code. 0 if success.
 */
public static int run(String[] args,ClassLoader classLoader) throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {
  final Options options=new Options();
  if (args.length == 0) {
    usage();
    return -1;
  }
  for (  String arg : args) {
    if (arg.equals("String_Node_Str")) {
      usage();
      return -1;
    }
    if (arg.equals("String_Node_Str")) {
      System.out.println(Messages.VERSION.format());
      return -1;
    }
  }
  try {
    options.parseArguments(args);
  }
 catch (  BadCommandLineException e) {
    System.out.println(e.getMessage());
    System.out.println();
    usage();
    return -1;
  }
  Class schemagenRunner=classLoader.loadClass(Runner.class.getName());
  Method mainMethod=schemagenRunner.getDeclaredMethod("String_Node_Str",String[].class);
  List<String> aptargs=new ArrayList<String>();
  if (hasClass(options.arguments))   aptargs.add("String_Node_Str");
  File jaxbApi=findJaxbApiJar();
  if (jaxbApi != null) {
    if (options.classpath != null) {
      options.classpath=options.classpath + File.pathSeparatorChar + jaxbApi;
    }
 else {
      options.classpath=jaxbApi.getPath();
    }
  }
  aptargs.add("String_Node_Str");
  aptargs.add(options.classpath);
  if (options.targetDir != null) {
    aptargs.add("String_Node_Str");
    aptargs.add(options.targetDir.getPath());
  }
  aptargs.addAll(options.arguments);
  String[] argsarray=aptargs.toArray(new String[aptargs.size()]);
  return (Integer)mainMethod.invoke(null,new Object[]{argsarray});
}