Program: 146614
Project: 146614
Buggy source:
@Override public boolean equals(Object o){
  if (this == o) {
    return true;
  }
  if (o instanceof TreeElement) {
    TreeElement otherTreeElement=(TreeElement)o;
    final boolean doFieldsMatch=(name.equals(otherTreeElement.name) && multiplicity == otherTreeElement.multiplicity && flags == otherTreeElement.flags && dataType == otherTreeElement.dataType && ((instanceName != null && instanceName.equals(otherTreeElement.instanceName)) || (instanceName == null && otherTreeElement.instanceName == null)) && ((constraint != null && constraint.equals(otherTreeElement.constraint)) || (constraint == null && otherTreeElement.constraint == null)) && ((preloadHandler != null && preloadHandler.equals(otherTreeElement.preloadHandler)) || (preloadHandler == null && otherTreeElement.preloadHandler == null)) && ((preloadParams != null && preloadParams.equals(otherTreeElement.preloadParams)) || (preloadParams == null && otherTreeElement.preloadParams == null)) && ((namespace != null && namespace.equals(otherTreeElement.namespace)) || (namespace == null && otherTreeElement.namespace == null)) && ((value != null && value.uncast().getString().equals(otherTreeElement.value.uncast().getString())) || value == null && otherTreeElement.value == null));
    if (doFieldsMatch) {
      if (children != null) {
        if (otherTreeElement.children == null) {
          return false;
        }
        for (        TreeElement child : children) {
          if (!otherTreeElement.children.contains(child)) {
            return false;
          }
        }
      }
 else {
        if (otherTreeElement.children != null) {
          return false;
        }
      }
      if (attributes != null) {
        if (otherTreeElement.attributes == null) {
          return false;
        }
        for (        TreeElement attr : attributes) {
          if (!otherTreeElement.attributes.contains(attr)) {
            return false;
          }
        }
      }
 else {
        if (otherTreeElement.attributes != null) {
          return false;
        }
      }
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean equals(Object o){
  if (this == o) {
    return true;
  }
  if (o instanceof TreeElement) {
    TreeElement otherTreeElement=(TreeElement)o;
    final boolean doFieldsMatch=doFieldsMatch(otherTreeElement) && multiplicity == otherTreeElement.multiplicity;
    if (doFieldsMatch) {
      if (children != null) {
        if (otherTreeElement.children == null) {
          return false;
        }
        for (        TreeElement child : children) {
          if (!otherTreeElement.children.contains(child)) {
            return false;
          }
        }
      }
 else {
        if (otherTreeElement.children != null) {
          return false;
        }
      }
      if (attributes != null) {
        if (otherTreeElement.attributes == null) {
          return false;
        }
        for (        TreeElement attr : attributes) {
          if (!otherTreeElement.attributes.contains(attr)) {
            return false;
          }
        }
      }
 else {
        if (otherTreeElement.attributes != null) {
          return false;
        }
      }
      return true;
    }
  }
  return false;
}