Program: 43628
Project: 43628
Buggy source:
/** 
 * The function try to return the file path of one class or package. If it exists in regular directory, it will return as "D:/folder/folder/name.class" in windows, and "/folder/folder/name.class" in unix like system. <p> If the class file exists in one jar file, it will return the path like: <b>'XXXXXXXfile:\XXXXXX\XXX.jar!\XX\XX\XX'</b> <p> use ClassLoader.getResources(String) to search resources in classpath <p> <b style=color:red>Note:</b> <p> We use new <i>ClassLoader(){}</i> to instead of <i>classZ.getClassLoader()</i>, for the reason: in <b>GAE</b> , it will fail if you call getClassLoader() <br> <br>
 * @param base : the class file name or package dir name
 * @return path or null if nothing found
 * @author Wendal Chen
 * @author zozoh
 * @see java.lang.ClassLoader
 * @see java.io.File
 */
private static File getBasePath(String base){
  try {
    Enumeration<URL> urls=new ClassLoader(){
    }
.getResources(base);
    File file=null;
    if (null != urls && urls.hasMoreElements()) {
      URL url=urls.nextElement();
      if (url != null) {
        String path=url.getFile();
        path=decodePath(path);
        file=new File(path);
      }
    }
    if (null == file)     file=Files.findFile(base);
    if (null == file)     return null;
    try {
      if (file.isDirectory())       return file;
    }
 catch (    SecurityException e) {
    }
    return file.getParentFile();
  }
 catch (  IOException e) {
  }
  return null;
}

Fixed version (ground truth):
/** 
 * The function try to return the file path of one class or package. If it exists in regular directory, it will return as "D:/folder/folder/name.class" in windows, and "/folder/folder/name.class" in unix like system. <p> If the class file exists in one jar file, it will return the path like: <b>'XXXXXXXfile:\XXXXXX\XXX.jar!\XX\XX\XX'</b> <p> use ClassLoader.getResources(String) to search resources in classpath <p> <b style=color:red>Note:</b> <p> We use new <i>ClassLoader(){}</i> to instead of <i>classZ.getClassLoader()</i>, for the reason: in <b>GAE</b> , it will fail if you call getClassLoader() <br> <br>
 * @param base : the class file name or package dir name
 * @return path or null if nothing found
 * @author Wendal Chen
 * @author zozoh
 * @see java.lang.ClassLoader
 * @see java.io.File
 */
private static File getBasePath(String base){
  if (log.isDebugEnabled())   log.debugf("String_Node_Str",base);
  try {
    Enumeration<URL> urls=new ClassLoader(){
    }
.getResources(base);
    File file=null;
    if (null != urls && urls.hasMoreElements()) {
      URL url=urls.nextElement();
      if (url != null) {
        String path=url.getFile();
        path=decodePath(path);
        file=new File(path);
      }
    }
    if (log.isDebugEnabled())     log.debugf("String_Node_Str",file);
    if (null == file) {
      file=Files.findFile(base);
      if (log.isDebugEnabled())       log.debugf("String_Node_Str",file);
    }
    if (null == file)     return null;
    try {
      if (file.isDirectory())       return file;
    }
 catch (    SecurityException e) {
    }
    if (log.isDebugEnabled())     log.debugf("String_Node_Str",file.getParentFile());
    return file.getParentFile();
  }
 catch (  IOException e) {
  }
  return null;
}