Program: 85293
Project: 85293
Buggy source:
private SootField resolve(StringBuffer trace){
  SootClass cl=declaringClass;
  while (true) {
    if (trace != null)     trace.append("String_Node_Str" + cl + "String_Node_Str"+ cl.getFields()+ "String_Node_Str");
    SootField clField=cl.getFieldUnsafe(name,type);
    if (clField != null) {
      return checkStatic(clField);
    }
 else     if (Scene.v().allowsPhantomRefs() && cl.isPhantom()) {
      SootField f=new SootField(name,type,isStatic() ? Modifier.STATIC : 0);
      f.setPhantom(true);
synchronized (cl) {
        clField=cl.getFieldUnsafe(name,type);
        if (clField != null)         return checkStatic(clField);
 else {
          cl.addField(f);
          return f;
        }
      }
    }
 else {
      LinkedList<SootClass> queue=new LinkedList<SootClass>();
      queue.addAll(cl.getInterfaces());
      while (!queue.isEmpty()) {
        SootClass iface=queue.removeFirst();
        if (trace != null)         trace.append("String_Node_Str" + iface + "String_Node_Str"+ iface.getFields()+ "String_Node_Str");
        SootField ifaceField=iface.getFieldUnsafe(name,type);
        if (ifaceField != null) {
          return checkStatic(ifaceField);
        }
        queue.addAll(iface.getInterfaces());
      }
      if (cl.hasSuperclass())       cl=cl.getSuperclass();
 else       break;
    }
  }
  if (Options.v().allow_phantom_refs()) {
    SootField sf=new SootField(name,type,isStatic ? Modifier.STATIC : 0);
    sf.setPhantom(true);
synchronized (declaringClass) {
      SootField clField=cl.getFieldUnsafe(name,type);
      if (clField != null)       return checkStatic(clField);
 else {
        declaringClass.addField(sf);
        return sf;
      }
    }
  }
  if (trace == null) {
    FieldResolutionFailedException e=new FieldResolutionFailedException();
    if (Options.v().ignore_resolution_errors())     G.v().out.println(e.getMessage());
 else     throw e;
  }
  return null;
}

Fixed version (ground truth):
private SootField resolve(StringBuffer trace){
  SootClass cl=declaringClass;
  while (true) {
    if (trace != null)     trace.append("String_Node_Str" + cl + "String_Node_Str"+ cl.getFields()+ "String_Node_Str");
synchronized (cl) {
      SootField clField=cl.getFieldUnsafe(name,type);
      if (clField != null) {
        return checkStatic(clField);
      }
 else       if (Scene.v().allowsPhantomRefs() && cl.isPhantom()) {
        SootField f=new SootField(name,type,isStatic() ? Modifier.STATIC : 0);
        f.setPhantom(true);
        cl.addField(f);
        return f;
      }
 else {
        LinkedList<SootClass> queue=new LinkedList<SootClass>();
        queue.addAll(cl.getInterfaces());
        while (!queue.isEmpty()) {
          SootClass iface=queue.removeFirst();
          if (trace != null)           trace.append("String_Node_Str" + iface + "String_Node_Str"+ iface.getFields()+ "String_Node_Str");
          SootField ifaceField=iface.getFieldUnsafe(name,type);
          if (ifaceField != null) {
            return checkStatic(ifaceField);
          }
          queue.addAll(iface.getInterfaces());
        }
        if (cl.hasSuperclass())         cl=cl.getSuperclass();
 else         break;
      }
    }
  }
  if (Options.v().allow_phantom_refs()) {
    SootField sf=new SootField(name,type,isStatic ? Modifier.STATIC : 0);
    sf.setPhantom(true);
synchronized (declaringClass) {
      SootField clField=cl.getFieldUnsafe(name,type);
      if (clField != null)       return checkStatic(clField);
 else {
        declaringClass.addField(sf);
        return sf;
      }
    }
  }
  if (trace == null) {
    FieldResolutionFailedException e=new FieldResolutionFailedException();
    if (Options.v().ignore_resolution_errors())     G.v().out.println(e.getMessage());
 else     throw e;
  }
  return null;
}