Program: 152969
Project: 152969
Buggy source:
private Version checkBundleForClass(Bundle bundle,String name,Version iversion){
  String packageName=name.substring(0,name.lastIndexOf('.'));
  Version hasExport=hasExport(bundle,packageName);
  if (hasExport != null && !hasExport.equals(iversion)) {
    if (log.isTraceEnabled())     log.trace("String_Node_Str" + getBundleName(bundle) + "String_Node_Str"+ packageName+ "String_Node_Str"+ hasExport+ "String_Node_Str"+ iversion+ "String_Node_Str");
    return hasExport;
  }
  String cname=name.substring(packageName.length() + 1) + "String_Node_Str";
  Enumeration e=bundle.findEntries("String_Node_Str" + packageName.replace('.','/'),cname,false);
  if (e == null) {
    if (hasExport != null) {
      URL url=checkBundleJarsForClass(bundle,name);
      if (url != null) {
        if (log.isTraceEnabled())         log.trace("String_Node_Str" + getBundleName(bundle) + "String_Node_Str"+ cname+ "String_Node_Str"+ url.toString()+ "String_Node_Str");
      }
 else {
        if (log.isTraceEnabled())         log.trace("String_Node_Str" + getBundleName(bundle) + "String_Node_Str"+ cname+ "String_Node_Str");
      }
    }
    String root="String_Node_Str";
    String fileName=packageName;
    if (packageName.lastIndexOf("String_Node_Str") >= 0) {
      root=root + packageName.substring(0,packageName.lastIndexOf("String_Node_Str")).replace('.','/');
      fileName=packageName.substring(packageName.lastIndexOf("String_Node_Str") + 1).replace('.','/');
    }
    Enumeration pe=bundle.findEntries(root,fileName,false);
    if (pe != null) {
      if (hasExport != null) {
        if (log.isTraceEnabled())         log.trace("String_Node_Str" + getBundleName(bundle) + "String_Node_Str"+ packageName+ "String_Node_Str");
      }
 else {
        if (log.isTraceEnabled())         log.trace("String_Node_Str" + getBundleName(bundle) + "String_Node_Str"+ packageName+ "String_Node_Str");
      }
    }
  }
 else {
    if (hasExport != null) {
      if (log.isTraceEnabled())       log.trace("String_Node_Str" + getBundleName(bundle) + "String_Node_Str"+ cname+ "String_Node_Str"+ hasExport+ "String_Node_Str");
      Class c=null;
      try {
        c=bundle.loadClass(name);
      }
 catch (      ClassNotFoundException e1) {
      }
      if (log.isTraceEnabled())       log.trace("String_Node_Str" + getBundleName(bundle) + "String_Node_Str"+ cname+ "String_Node_Str"+ c+ "String_Node_Str");
    }
 else {
      if (log.isTraceEnabled())       log.trace("String_Node_Str" + getBundleName(bundle) + "String_Node_Str"+ cname+ "String_Node_Str");
    }
  }
  return hasExport;
}

Fixed version (ground truth):
private static Version checkBundleForClass(Bundle bundle,String name,Version iversion){
  String packageName=name.substring(0,name.lastIndexOf('.'));
  Version hasExport=hasExport(bundle,packageName);
  if (hasExport != null && !hasExport.equals(iversion)) {
    if (log.isTraceEnabled())     log.trace("String_Node_Str" + getBundleName(bundle) + "String_Node_Str"+ packageName+ "String_Node_Str"+ hasExport+ "String_Node_Str"+ iversion+ "String_Node_Str");
    return hasExport;
  }
  String cname=name.substring(packageName.length() + 1) + "String_Node_Str";
  Enumeration e=bundle.findEntries("String_Node_Str" + packageName.replace('.','/'),cname,false);
  if (e == null) {
    if (hasExport != null) {
      URL url=checkBundleJarsForClass(bundle,name);
      if (url != null) {
        if (log.isTraceEnabled())         log.trace("String_Node_Str" + getBundleName(bundle) + "String_Node_Str"+ cname+ "String_Node_Str"+ url.toString()+ "String_Node_Str");
      }
 else {
        if (log.isTraceEnabled())         log.trace("String_Node_Str" + getBundleName(bundle) + "String_Node_Str"+ cname+ "String_Node_Str");
      }
    }
    String root="String_Node_Str";
    String fileName=packageName;
    if (packageName.lastIndexOf("String_Node_Str") >= 0) {
      root=root + packageName.substring(0,packageName.lastIndexOf("String_Node_Str")).replace('.','/');
      fileName=packageName.substring(packageName.lastIndexOf("String_Node_Str") + 1).replace('.','/');
    }
    Enumeration pe=bundle.findEntries(root,fileName,false);
    if (pe != null) {
      if (hasExport != null) {
        if (log.isTraceEnabled())         log.trace("String_Node_Str" + getBundleName(bundle) + "String_Node_Str"+ packageName+ "String_Node_Str");
      }
 else {
        if (log.isTraceEnabled())         log.trace("String_Node_Str" + getBundleName(bundle) + "String_Node_Str"+ packageName+ "String_Node_Str");
      }
    }
  }
 else {
    if (hasExport != null) {
      if (log.isTraceEnabled())       log.trace("String_Node_Str" + getBundleName(bundle) + "String_Node_Str"+ cname+ "String_Node_Str"+ hasExport+ "String_Node_Str");
      Class c=null;
      try {
        c=bundle.loadClass(name);
      }
 catch (      ClassNotFoundException e1) {
      }
      if (log.isTraceEnabled())       log.trace("String_Node_Str" + getBundleName(bundle) + "String_Node_Str"+ cname+ "String_Node_Str"+ c+ "String_Node_Str");
    }
 else {
      if (log.isTraceEnabled())       log.trace("String_Node_Str" + getBundleName(bundle) + "String_Node_Str"+ cname+ "String_Node_Str");
    }
  }
  return hasExport;
}