Program: 134804
Project: 134804
Buggy source:
public static Object getChild(String name,Object node){
  if (node instanceof DAOImpl) {
    return (XMLTreeNode)(((DAOImpl)node).getRootNode().getNodesMap().get(name));
  }
  if (node instanceof XMLTreeNode) {
    Object n=(XMLTreeNode)(((XMLTreeNode)node).getNodesMap().get(name));
    if (n != null)     return n;
 else     return ((XMLTreeNode)node).getFieldMap().get(name);
  }
 else   if (node instanceof Map) {
    Map map=(Map)node;
    if (map.containsKey(name))     return map.get(name);
    return null;
  }
 else   if (node instanceof Element) {
    Element element=(Element)node;
    if (element.hasAttribute(name))     return element.getAttribute(name);
    NodeList nodeList=element.getElementsByTagName(name);
    if (nodeList.getLength() > 0)     return (Element)nodeList.item(0);
    return null;
  }
 else {
    Field field=null;
    final Class nodeType=node.getClass();
    Class type=nodeType;
    while (field == null && type != null) {
      try {
        field=type.getDeclaredField(name);
      }
 catch (      NoSuchFieldException e) {
      }
      type=type.getSuperclass();
    }
    if (field != null) {
      if (name.equals(SUBNODES_MAP_NAME)) {
        try {
          return field.get(node);
        }
 catch (        IllegalAccessException e) {
          return null;
        }
      }
 else {
        try {
          Method accessorMethod=getAccessorMethod(nodeType,name);
          Object retVal=accessorMethod.invoke(node,(Object[])null);
          return retVal;
        }
 catch (        Throwable th) {
          return null;
        }
      }
    }
 else     if (!name.equals(SUBNODES_MAP_NAME)) {
      if (node instanceof ExtraDataFeature) {
        Element extraData=((ExtraDataFeature)node).getExtraData();
        if (extraData != null) {
          Object viaExtra=getChild(name,extraData);
          if (viaExtra != null)           return viaExtra;
        }
      }
      Object subnodesMap=getChild(SUBNODES_MAP_NAME,node);
      if (subnodesMap instanceof Map)       return ((Map)subnodesMap).get(name);
    }
    return null;
  }
}

Fixed version (ground truth):
public static Object getChild(String name,Object node){
synchronized (node) {
    if (node instanceof DAOImpl) {
      return (XMLTreeNode)(((DAOImpl)node).getRootNode().getNodesMap().get(name));
    }
    if (node instanceof XMLTreeNode) {
      Object n=(XMLTreeNode)(((XMLTreeNode)node).getNodesMap().get(name));
      if (n != null)       return n;
 else       return ((XMLTreeNode)node).getFieldMap().get(name);
    }
 else     if (node instanceof Map) {
      Map map=(Map)node;
      if (map.containsKey(name))       return map.get(name);
      return null;
    }
 else     if (node instanceof Element) {
      Element element=(Element)node;
      if (element.hasAttribute(name))       return element.getAttribute(name);
      NodeList nodeList=element.getElementsByTagName(name);
      if (nodeList.getLength() > 0)       return (Element)nodeList.item(0);
      return null;
    }
 else {
      Field field=null;
      final Class nodeType=node.getClass();
      Class type=nodeType;
      while (field == null && type != null) {
        try {
          field=type.getDeclaredField(name);
        }
 catch (        NoSuchFieldException e) {
        }
        type=type.getSuperclass();
      }
      if (field != null) {
        if (name.equals(SUBNODES_MAP_NAME)) {
          try {
            return field.get(node);
          }
 catch (          IllegalAccessException e) {
            return null;
          }
        }
 else {
          try {
            Method accessorMethod=getAccessorMethod(nodeType,name);
            Object retVal=accessorMethod.invoke(node,(Object[])null);
            return retVal;
          }
 catch (          Throwable th) {
            return null;
          }
        }
      }
 else       if (!name.equals(SUBNODES_MAP_NAME)) {
        if (node instanceof ExtraDataFeature) {
          Element extraData=((ExtraDataFeature)node).getExtraData();
          if (extraData != null) {
            Object viaExtra=getChild(name,extraData);
            if (viaExtra != null)             return viaExtra;
          }
        }
        Object subnodesMap=getChild(SUBNODES_MAP_NAME,node);
        if (subnodesMap instanceof Map)         return ((Map)subnodesMap).get(name);
      }
      return null;
    }
  }
}