Program: 73367
Project: 73367
Buggy source:
/** 
 * Given the name of a file or a URL, convert it to a URL. This first attempts to do that directly by invoking a URL constructor. If that fails, then it tries to interpret the spec as a file name on the local file system.  If that fails, then it tries to interpret the spec as a resource accessible to the class loader, which uses the classpath to find the resource.  If that fails, then it throws an exception.  The specification can give a file name relative to current working directory, or the directory in which this application is started up.
 * @param spec The specification.
 * @return the URL.
 * @exception IOException If it cannot convert the specification toa URL.
 */
public static URL specToURL(String spec) throws IOException {
  URL specURL=null;
  try {
    specURL=new URL(null,spec);
    InputStream urlStream=specURL.openStream();
    urlStream.close();
    return specURL;
  }
 catch (  Exception ex) {
    try {
      File file=new File(spec);
      File absoluteFile=file.getAbsoluteFile();
      try {
        if (!absoluteFile.exists()) {
          throw new IOException("String_Node_Str" + absoluteFile + "String_Node_Str");
        }
      }
 catch (      java.security.AccessControlException accessControl) {
        IOException exception=new IOException("String_Node_Str" + "String_Node_Str" + absoluteFile + "String_Node_Str");
        exception.initCause(accessControl);
        throw exception;
      }
      specURL=absoluteFile.getCanonicalFile().toURI().toURL();
      return specURL;
    }
 catch (    Exception ex2) {
      try {
        specURL=Thread.currentThread().getContextClassLoader().getResource(spec);
        if (specURL == null) {
          throw new Exception("String_Node_Str" + spec + "String_Node_Str");
        }
 else {
          specURL=JNLPUtilities.canonicalizeJarURL(specURL);
          InputStream urlStream=specURL.openStream();
          urlStream.close();
          return specURL;
        }
      }
 catch (      Exception ex3) {
        IOException exception=new IOException("String_Node_Str" + spec + "String_Node_Str"+ ex+ "String_Node_Str"+ ex2+ "String_Node_Str"+ ex3);
        exception.initCause(ex3);
        throw exception;
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Given the name of a file or a URL, convert it to a URL. This first attempts to do that directly by invoking a URL constructor. If that fails, then it tries to interpret the spec as a file name on the local file system.  If that fails, then it tries to interpret the spec as a resource accessible to the class loader, which uses the classpath to find the resource.  If that fails, then it throws an exception.  The specification can give a file name relative to current working directory, or the directory in which this application is started up.
 * @param spec The specification.
 * @return the URL.
 * @exception IOException If it cannot convert the specification toa URL.
 */
public static URL specToURL(String spec) throws IOException {
  URL specURL=null;
  try {
    specURL=new URL(null,spec);
    InputStream urlStream=specURL.openStream();
    urlStream.close();
    return specURL;
  }
 catch (  Exception ex) {
    try {
      File file=new File(spec);
      File absoluteFile=file.getAbsoluteFile();
      try {
        if (!absoluteFile.exists()) {
          throw new IOException("String_Node_Str" + absoluteFile + "String_Node_Str");
        }
      }
 catch (      java.security.AccessControlException accessControl) {
        IOException exception=new IOException("String_Node_Str" + "String_Node_Str" + absoluteFile + "String_Node_Str");
        exception.initCause(accessControl);
        throw exception;
      }
      specURL=absoluteFile.getCanonicalFile().toURI().toURL();
      return specURL;
    }
 catch (    Throwable throwable) {
      try {
        specURL=Thread.currentThread().getContextClassLoader().getResource(spec);
        if (specURL == null) {
          throw new Exception("String_Node_Str" + spec + "String_Node_Str");
        }
 else {
          specURL=JNLPUtilities.canonicalizeJarURL(specURL);
          InputStream urlStream=specURL.openStream();
          urlStream.close();
          return specURL;
        }
      }
 catch (      Exception ex3) {
        IOException exception=new IOException("String_Node_Str" + spec + "String_Node_Str"+ ex+ "String_Node_Str"+ throwable+ "String_Node_Str"+ ex3);
        exception.initCause(ex3);
        throw exception;
      }
    }
  }
}