Program: 112508
Project: 112508
Buggy source:
/** 
 * Creates an instance from a given classpath resource root location, using the given class loader to find the resource. <p> This is designed to handle resource roots which may physically correspond to a directory on disk, or be located within a jar file.
 * @param resourceRoot  the resource root path
 * @param classLoader  the class loader with which to find the resource
 * @return the market data builder
 */
public static MarketDataBuilder ofResource(String resourceRoot,ClassLoader classLoader){
  String qualifiedResourceRoot=resourceRoot.startsWith(File.separator) ? resourceRoot.substring(1) : resourceRoot;
  URL url=classLoader.getResource(qualifiedResourceRoot);
  if (url == null) {
    throw new IllegalArgumentException(Messages.format("String_Node_Str",resourceRoot));
  }
  if (url.getProtocol() != null && "String_Node_Str".equals(url.getProtocol().toLowerCase())) {
    int classSeparatorIdx=url.getFile().indexOf("String_Node_Str");
    if (classSeparatorIdx == -1) {
      throw new IllegalArgumentException(Messages.format("String_Node_Str",url));
    }
    String jarPath=url.getFile().substring("String_Node_Str".length(),classSeparatorIdx);
    File jarFile;
    try {
      jarFile=new File(jarPath);
    }
 catch (    Exception e) {
      throw new IllegalArgumentException(Messages.format("String_Node_Str",jarPath),e);
    }
    return new JarMarketDataBuilder(jarFile,resourceRoot);
  }
 else {
    File file;
    try {
      file=new File(url.toURI());
    }
 catch (    URISyntaxException e) {
      throw new IllegalArgumentException(Messages.format("String_Node_Str",url),e);
    }
    return new DirectoryMarketDataBuilder(file.toPath());
  }
}

Fixed version (ground truth):
/** 
 * Creates an instance from a given classpath resource root location, using the given class loader to find the resource. <p> This is designed to handle resource roots which may physically correspond to a directory on disk, or be located within a jar file.
 * @param resourceRoot  the resource root path
 * @param classLoader  the class loader with which to find the resource
 * @return the market data builder
 */
public static MarketDataBuilder ofResource(String resourceRoot,ClassLoader classLoader){
  String qualifiedResourceRoot=resourceRoot.startsWith(File.separator) ? resourceRoot.substring(1) : resourceRoot;
  if (!qualifiedResourceRoot.endsWith(File.separator)) {
    qualifiedResourceRoot+=File.separator;
  }
  URL url=classLoader.getResource(qualifiedResourceRoot);
  if (url == null) {
    throw new IllegalArgumentException(Messages.format("String_Node_Str",resourceRoot));
  }
  if (url.getProtocol() != null && "String_Node_Str".equals(url.getProtocol().toLowerCase())) {
    int classSeparatorIdx=url.getFile().indexOf("String_Node_Str");
    if (classSeparatorIdx == -1) {
      throw new IllegalArgumentException(Messages.format("String_Node_Str",url));
    }
    String jarPath=url.getFile().substring("String_Node_Str".length(),classSeparatorIdx);
    File jarFile;
    try {
      jarFile=new File(jarPath);
    }
 catch (    Exception e) {
      throw new IllegalArgumentException(Messages.format("String_Node_Str",jarPath),e);
    }
    return new JarMarketDataBuilder(jarFile,resourceRoot);
  }
 else {
    File file;
    try {
      file=new File(url.toURI());
    }
 catch (    URISyntaxException e) {
      throw new IllegalArgumentException(Messages.format("String_Node_Str",url),e);
    }
    return new DirectoryMarketDataBuilder(file.toPath());
  }
}