Program: 152981
Project: 152981
Buggy source:
/** 
 * A best-guess attempt at figuring out why the class could not be found.
 * @param name of the class we are trying to find.
 */
private synchronized void debugClassLoading(String name,String root){
  Dictionary dict=backingBundle.getHeaders();
  String bname=dict.get(Constants.BUNDLE_NAME) + "String_Node_Str" + dict.get(Constants.BUNDLE_SYMBOLICNAME)+ "String_Node_Str";
  log.debug("String_Node_Str" + name + "String_Node_Str"+ bname+ "String_Node_Str");
  BundleContext context=OsgiResourceUtils.getBundleContext(backingBundle);
  String packageName=name.substring(0,name.lastIndexOf('.'));
  if (name.indexOf('.') < 0) {
    log.debug("String_Node_Str");
    return;
  }
  Version iversion=hasImport(backingBundle,packageName);
  if (iversion != null) {
    log.debug("String_Node_Str" + iversion + "String_Node_Str");
    Bundle[] bundles=context.getBundles();
    for (int i=0; i < bundles.length; i++) {
      if (bundles[i].getBundleId() != backingBundle.getBundleId()) {
        Version exported=checkBundleForClass(bundles[i],name,iversion);
        if (exported != null && exported.equals(iversion) && root != null) {
          for (int j=0; j < bundles.length; j++) {
            Version rootexport=hasExport(bundles[j],root.substring(0,root.lastIndexOf('.')));
            if (rootexport != null) {
              Version rootimport=hasImport(bundles[j],packageName);
              if (rootimport == null || !rootimport.equals(iversion)) {
                log.debug("String_Node_Str" + getBundleName(bundles[j]) + "String_Node_Str"+ root+ "String_Node_Str"+ rootexport+ "String_Node_Str"+ packageName+ "String_Node_Str"+ iversion+ "String_Node_Str");
              }
            }
          }
        }
      }
    }
  }
  if (hasExport(backingBundle,packageName) != null) {
    log.debug("String_Node_Str");
    checkBundleForClass(backingBundle,name,iversion);
  }
}

Fixed version (ground truth):
/** 
 * A best-guess attempt at figuring out why the class could not be found.
 * @param name of the class we are trying to find.
 */
private synchronized void debugClassLoading(String name,String root){
  Dictionary dict=backingBundle.getHeaders();
  String bname=dict.get(Constants.BUNDLE_NAME) + "String_Node_Str" + dict.get(Constants.BUNDLE_SYMBOLICNAME)+ "String_Node_Str";
  log.debug("String_Node_Str" + name + "String_Node_Str"+ bname+ "String_Node_Str");
  BundleContext context=OsgiResourceUtils.getBundleContext(backingBundle);
  String packageName=name.substring(0,name.lastIndexOf('.'));
  if (name.indexOf('.') < 0) {
    log.debug("String_Node_Str");
    return;
  }
  Version iversion=hasImport(backingBundle,packageName);
  if (iversion != null && context != null) {
    log.debug("String_Node_Str" + iversion + "String_Node_Str");
    Bundle[] bundles=context.getBundles();
    for (int i=0; i < bundles.length; i++) {
      if (bundles[i].getBundleId() != backingBundle.getBundleId()) {
        Version exported=checkBundleForClass(bundles[i],name,iversion);
        if (exported != null && exported.equals(iversion) && root != null) {
          for (int j=0; j < bundles.length; j++) {
            Version rootexport=hasExport(bundles[j],root.substring(0,root.lastIndexOf('.')));
            if (rootexport != null) {
              Version rootimport=hasImport(bundles[j],packageName);
              if (rootimport == null || !rootimport.equals(iversion)) {
                log.debug("String_Node_Str" + getBundleName(bundles[j]) + "String_Node_Str"+ root+ "String_Node_Str"+ rootexport+ "String_Node_Str"+ packageName+ "String_Node_Str"+ iversion+ "String_Node_Str");
              }
            }
          }
        }
      }
    }
  }
  if (hasExport(backingBundle,packageName) != null) {
    log.debug("String_Node_Str");
    checkBundleForClass(backingBundle,name,iversion);
  }
}