Program: 177663
Project: 177663
Buggy source:
/** 
 * Returns list of   {@link Class} types of available classes types annotatedwith @ {@link Entity} from given package, recursively.
 * @param packageName Entity container package
 * @return List of all annotated classes
 */
public static List<Class<?>> findEntitiesInPackage(String packageName){
  String packageUrl, fileName;
  URL element;
  Enumeration<URL> classResources;
  List<Class<?>> classObjects;
  List<Class<?>> annotatedClasses=null;
  ClassLoader classLoader=Thread.currentThread().getContextClassLoader();
  if (classLoader == null)   return null;
  packageUrl=packageName.replace('.','/');
  try {
    classResources=classLoader.getResources(packageUrl);
  }
 catch (  IOException e) {
    Log.error(e.getMessage());
    return null;
  }
  classObjects=new ArrayList<Class<?>>();
  while (classResources.hasMoreElements()) {
    element=classResources.nextElement();
    try {
      fileName=URLDecoder.decode(element.getFile(),"String_Node_Str");
    }
 catch (    UnsupportedEncodingException e) {
      try {
        fileName=URLDecoder.decode(element.getFile(),"String_Node_Str");
      }
 catch (      UnsupportedEncodingException e1) {
        fileName=element.getFile().replace("String_Node_Str","String_Node_Str");
      }
    }
    annotatedClasses=populateClasses(new File(fileName),packageName);
    for (    Class<?> currentClass : annotatedClasses) {
      if (currentClass != null && currentClass.isAnnotationPresent(org.orman.mapper.annotation.Entity.class)) {
        classObjects.add(currentClass);
      }
    }
  }
  return classObjects.size() == 0 ? null : classObjects;
}

Fixed version (ground truth):
/** 
 * Returns list of   {@link Class} types of available classes types annotatedwith @ {@link Entity} from given package, recursively.
 * @param packageName Entity container package
 * @return List of all annotated classes
 */
public static List<Class<?>> findEntitiesInPackage(String packageName){
  String packageUrl=null, fileName;
  URL element;
  Enumeration<URL> classResources;
  List<Class<?>> classObjects;
  List<Class<?>> annotatedClasses=null;
  ClassLoader classLoader=Thread.currentThread().getContextClassLoader();
  if (classLoader == null)   return null;
  if (packageName == null)   packageUrl="String_Node_Str";
 else   packageUrl=packageName.replace('.','/');
  try {
    classResources=classLoader.getResources(packageUrl);
  }
 catch (  IOException e) {
    Log.error(e.getMessage());
    return null;
  }
  classObjects=new ArrayList<Class<?>>();
  while (classResources.hasMoreElements()) {
    element=classResources.nextElement();
    try {
      fileName=URLDecoder.decode(element.getFile(),"String_Node_Str");
    }
 catch (    UnsupportedEncodingException e) {
      try {
        fileName=URLDecoder.decode(element.getFile(),"String_Node_Str");
      }
 catch (      UnsupportedEncodingException e1) {
        fileName=element.getFile().replace("String_Node_Str","String_Node_Str");
      }
    }
    annotatedClasses=populateClasses(new File(fileName),packageName);
    for (    Class<?> currentClass : annotatedClasses) {
      if (currentClass != null && currentClass.isAnnotationPresent(org.orman.mapper.annotation.Entity.class)) {
        classObjects.add(currentClass);
      }
    }
  }
  return classObjects.size() == 0 ? null : classObjects;
}