Program: 44010
Project: 44010
Buggy source:
void doAppendToDocument(Document doc,Element parent){
  int mods=jclass.getModifiers();
  boolean is_annotation=false;
  Element e=doc.createElement(jclass.isInterface() && !jclass.isAnnotation() ? "String_Node_Str" : "String_Node_Str");
  if (!jclass.isInterface() || jclass.isAnnotation()) {
    Type t=jclass.getGenericSuperclass();
    if (t != null)     e.setAttribute("String_Node_Str",getGenericTypeName(t));
    Class t2=jclass.getSuperclass();
    if (t2 != null)     e.setAttribute("String_Node_Str",getClassName(t2,true));
  }
  String className=getClassName(jclass,false);
  e.setAttribute("String_Node_Str",className);
  e.setAttribute("String_Node_Str",Modifier.isFinal(mods) ? "String_Node_Str" : "String_Node_Str");
  e.setAttribute("String_Node_Str",Modifier.isStatic(mods) ? "String_Node_Str" : "String_Node_Str");
  e.setAttribute("String_Node_Str",Modifier.isAbstract(mods) ? "String_Node_Str" : "String_Node_Str");
  e.setAttribute("String_Node_Str",Modifier.isPublic(mods) ? "String_Node_Str" : Modifier.isProtected(mods) ? "String_Node_Str" : "String_Node_Str");
  if (is_obfuscated)   e.setAttribute("String_Node_Str",Boolean.toString(is_obfuscated));
  Element typeParameters=getTypeParametersNode(doc,jclass.getTypeParameters());
  if (typeParameters != null)   e.appendChild(typeParameters);
  setDeprecatedAttr(e,jclass.getDeclaredAnnotations(),e.getAttribute("String_Node_Str"));
  Type[] ifaces=jclass.getGenericInterfaces();
  sortTypes(ifaces);
  for (  Type iface : ifaces) {
    Element iface_elem=doc.createElement("String_Node_Str");
    if (iface instanceof Class)     iface_elem.setAttribute("String_Node_Str",getClassName((Class)iface,true));
 else     if (iface instanceof ParameterizedType) {
      ParameterizedType pt=(ParameterizedType)iface;
      if (pt.getRawType() instanceof Class)       iface_elem.setAttribute("String_Node_Str",getClassName(((Class)pt.getRawType()),true));
    }
    iface_elem.setAttribute("String_Node_Str",getGenericTypeName(iface));
    iface_elem.appendChild(doc.createTextNode("String_Node_Str"));
    e.appendChild(iface_elem);
    if (iface_elem.getAttribute("String_Node_Str").equals("String_Node_Str"))     is_annotation=true;
  }
  for (  Constructor ctor : jclass.getDeclaredConstructors())   appendCtor(ctor,doc,e);
  Class base_class=jclass.getSuperclass();
  Map<String,Method> methods=new HashMap<String,Method>();
  for (  Method method : jclass.getDeclaredMethods()) {
    int mmods=method.getModifiers();
    int rtmods=method.getReturnType().getModifiers();
    if (!Modifier.isPublic(rtmods) && !Modifier.isProtected(rtmods))     continue;
    boolean nonPublic=false;
    Class[] ptypes=method.getParameterTypes();
    for (int pidx=0; pidx < ptypes.length; pidx++) {
      int ptmods=ptypes[pidx].getModifiers();
      if (!Modifier.isPublic(ptmods) && !Modifier.isProtected(ptmods))       nonPublic=true;
    }
    if (nonPublic)     continue;
    if (base_class != null && !Modifier.isFinal(mmods)) {
      Method base_method=null;
      Class ancestor=base_class;
      while (ancestor != null && base_method == null) {
        try {
          base_method=ancestor.getDeclaredMethod(method.getName(),method.getParameterTypes());
        }
 catch (        Exception ex) {
        }
        ancestor=ancestor.getSuperclass();
      }
      if (base_method != null) {
        int base_mods=base_method.getModifiers();
        int base_decl_class_mods=base_method.getDeclaringClass().getModifiers();
        if (!Modifier.isStatic(base_mods) && !Modifier.isAbstract(base_mods) && (Modifier.isPublic(mmods) == Modifier.isPublic(base_mods))&& Modifier.isPublic(base_decl_class_mods)) {
          if (!Modifier.isAbstract(mmods) || method.getName().equals("String_Node_Str")) {
            if (!method.getName().equals("String_Node_Str") || !jclass.getName().equals("String_Node_Str"))             continue;
          }
        }
      }
    }
    Comparator clscmp=new Comparator<Class>(){
      public int compare(      Class c1,      Class c2){
        return c1.getName().compareTo(c2.getName());
      }
    }
;
    if (Arrays.binarySearch(jclass.getInterfaces(),Comparable.class,clscmp) >= 0 && method.getName().equals("String_Node_Str") && ptypes[0].equals(Object.class) && !jclass.equals(java.io.ObjectStreamField.class))     continue;
    if (Arrays.binarySearch(jclass.getInterfaces(),Comparator.class,clscmp) >= 0 && method.getName().equals("String_Node_Str") && ptypes.length == 2 && ptypes[0].equals(Object.class) && ptypes[1].equals(Object.class))     continue;
    String key=getSignature(method);
    if (methods.containsKey(key)) {
      Type method_type=method.getGenericReturnType();
      Method hashed=methods.get(key);
      Type hashed_type=hashed.getGenericReturnType();
      Class mret=method_type instanceof Class ? (Class)method_type : null;
      Class hret=hashed_type instanceof Class ? (Class)hashed_type : null;
      if (mret == null || (hret != null && hret.isAssignableFrom(mret)))       methods.put(key,method);
 else       if (hret != null && !mret.isAssignableFrom(hret)) {
        System.err.print("String_Node_Str" + jclass.getName() + "String_Node_Str"+ key);
        System.err.println("String_Node_Str" + hashed.getGenericReturnType().toString() + "String_Node_Str"+ method.getGenericReturnType().toString());
      }
    }
 else {
      methods.put(key,method);
    }
  }
  ArrayList<String> sigs=new ArrayList<String>(methods.keySet());
  java.util.Collections.sort(sigs);
  for (  String sig : sigs)   appendMethod(methods.get(sig),doc,e);
  Field[] fields=getDeclaredFields();
  sortFields(fields);
  for (  Field field : fields)   appendField(field,asmFields.get(field.getName()),doc,e);
  parent.appendChild(e);
  if (is_annotation)   parent.appendChild(createAnnotationMock(doc,className));
}

Fixed version (ground truth):
void doAppendToDocument(Document doc,Element parent){
  int mods=jclass.getModifiers();
  boolean is_annotation=false;
  Element e=doc.createElement(jclass.isInterface() && !jclass.isAnnotation() ? "String_Node_Str" : "String_Node_Str");
  if (!jclass.isInterface() || jclass.isAnnotation()) {
    Type t=jclass.getGenericSuperclass();
    if (t != null)     e.setAttribute("String_Node_Str",getGenericTypeName(t));
    Class t2=jclass.getSuperclass();
    if (t2 != null)     e.setAttribute("String_Node_Str",getClassName(t2,true));
  }
  String className=getClassName(jclass,false);
  e.setAttribute("String_Node_Str",className);
  e.setAttribute("String_Node_Str",Modifier.isFinal(mods) ? "String_Node_Str" : "String_Node_Str");
  e.setAttribute("String_Node_Str",Modifier.isStatic(mods) ? "String_Node_Str" : "String_Node_Str");
  e.setAttribute("String_Node_Str",Modifier.isAbstract(mods) ? "String_Node_Str" : "String_Node_Str");
  e.setAttribute("String_Node_Str",Modifier.isPublic(mods) ? "String_Node_Str" : Modifier.isProtected(mods) ? "String_Node_Str" : "String_Node_Str");
  if (is_obfuscated)   e.setAttribute("String_Node_Str",Boolean.toString(is_obfuscated));
  Element typeParameters=getTypeParametersNode(doc,jclass.getTypeParameters());
  if (typeParameters != null)   e.appendChild(typeParameters);
  setDeprecatedAttr(e,jclass.getDeclaredAnnotations(),e.getAttribute("String_Node_Str"));
  Type[] ifaces=jclass.getGenericInterfaces();
  sortTypes(ifaces);
  for (  Type iface : ifaces) {
    Element iface_elem=doc.createElement("String_Node_Str");
    if (iface instanceof Class)     iface_elem.setAttribute("String_Node_Str",getClassName((Class)iface,true));
 else     if (iface instanceof ParameterizedType) {
      ParameterizedType pt=(ParameterizedType)iface;
      if (pt.getRawType() instanceof Class)       iface_elem.setAttribute("String_Node_Str",getClassName(((Class)pt.getRawType()),true));
    }
    iface_elem.setAttribute("String_Node_Str",getGenericTypeName(iface));
    iface_elem.appendChild(doc.createTextNode("String_Node_Str"));
    e.appendChild(iface_elem);
    if (iface_elem.getAttribute("String_Node_Str").equals("String_Node_Str"))     is_annotation=true;
  }
  for (  Constructor ctor : jclass.getDeclaredConstructors())   appendCtor(ctor,doc,e);
  Class base_class=jclass.getSuperclass();
  Map<String,Method> methods=new HashMap<String,Method>();
  for (  Method method : jclass.getDeclaredMethods()) {
    if (method.isSynthetic() && isInPublicInheritanceChain(jclass))     continue;
    int mmods=method.getModifiers();
    int rtmods=method.getReturnType().getModifiers();
    if (!Modifier.isPublic(rtmods) && !Modifier.isProtected(rtmods))     continue;
    boolean nonPublic=false;
    Class[] ptypes=method.getParameterTypes();
    for (int pidx=0; pidx < ptypes.length; pidx++) {
      int ptmods=ptypes[pidx].getModifiers();
      if (!Modifier.isPublic(ptmods) && !Modifier.isProtected(ptmods))       nonPublic=true;
    }
    if (nonPublic)     continue;
    if (base_class != null && !Modifier.isFinal(mmods)) {
      Method base_method=null;
      Class ancestor=base_class;
      while (ancestor != null && base_method == null) {
        try {
          base_method=ancestor.getDeclaredMethod(method.getName(),method.getParameterTypes());
        }
 catch (        Exception ex) {
        }
        ancestor=ancestor.getSuperclass();
      }
      if (base_method != null) {
        int base_mods=base_method.getModifiers();
        int base_decl_class_mods=base_method.getDeclaringClass().getModifiers();
        if (!Modifier.isStatic(base_mods) && !Modifier.isAbstract(base_mods) && (Modifier.isPublic(mmods) == Modifier.isPublic(base_mods))&& Modifier.isPublic(base_decl_class_mods)) {
          if (!Modifier.isAbstract(mmods) || method.getName().equals("String_Node_Str")) {
            if (!method.getName().equals("String_Node_Str") || !jclass.getName().equals("String_Node_Str"))             continue;
          }
        }
      }
    }
    String key=getGenericSignature(method);
    if (methods.containsKey(key)) {
      Type method_type=method.getGenericReturnType();
      Method hashed=methods.get(key);
      Type hashed_type=hashed.getGenericReturnType();
      Class mret=method_type instanceof Class ? (Class)method_type : null;
      Class hret=hashed_type instanceof Class ? (Class)hashed_type : null;
      if (mret == null || (hret != null && hret.isAssignableFrom(mret)))       methods.put(key,method);
 else       if (hret != null && !mret.isAssignableFrom(hret)) {
        System.err.print("String_Node_Str" + jclass.getName() + "String_Node_Str"+ key);
        System.err.println("String_Node_Str" + hashed.getGenericReturnType().toString() + "String_Node_Str"+ method.getGenericReturnType().toString());
      }
    }
 else {
      methods.put(key,method);
    }
  }
  ArrayList<String> sigs=new ArrayList<String>(methods.keySet());
  java.util.Collections.sort(sigs);
  for (  String sig : sigs)   appendMethod(methods.get(sig),doc,e);
  Field[] fields=getDeclaredFields();
  sortFields(fields);
  for (  Field field : fields)   appendField(field,asmFields.get(field.getName()),doc,e);
  parent.appendChild(e);
  if (is_annotation)   parent.appendChild(createAnnotationMock(doc,className));
}