Program: 12674
Project: 12674
Buggy source:
@Override public boolean equals(Object obj){
  if (this == obj)   return true;
  if (obj == null)   return false;
  if (getClass() != obj.getClass())   return false;
  Annotation other=(Annotation)obj;
  if (value == null) {
    if (other.value != null)     return false;
  }
 else   if (!value.equals(other.value)) {
    if (!this.getQName().equals(other.getQName())) {
      return false;
    }
 else     if ((this.getValue().getValue() instanceof Literal<?>) && (other.getValue().getValue() instanceof Literal<?>)) {
      if (!this.getStringValue().equals(other.getStringValue())) {
        return false;
      }
    }
 else     if ((this.getValue().getValue() instanceof NestedDocument<?>) && (other.getValue().getValue() instanceof NestedDocument<?>)) {
      if (!this.getNestedQName().equals(other.getNestedQName())) {
        return false;
      }
      if (!this.getNestedIdentity().equals(other.getNestedIdentity())) {
        return false;
      }
      if (this.getAnnotations().size() != other.getAnnotations().size()) {
        return false;
      }
      for (      Annotation annotation1 : this.getAnnotations()) {
        boolean foundIt=false;
        for (        Annotation annotation2 : other.getAnnotations()) {
          if (annotation1.equals(annotation2)) {
            foundIt=true;
            break;
          }
        }
        if (foundIt == false)         break;
      }
    }
 else {
      return false;
    }
    return true;
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  if (this == obj)   return true;
  if (obj == null)   return false;
  if (getClass() != obj.getClass())   return false;
  Annotation other=(Annotation)obj;
  if (value == null) {
    if (other.value != null)     return false;
  }
 else   if (!value.equals(other.value)) {
    if (!this.getQName().equals(other.getQName())) {
      return false;
    }
 else     if ((this.getValue().getValue() instanceof StringLiteral<?>) && (other.getValue().getValue() instanceof StringLiteral<?>)) {
      if (!this.getStringValue().equals(other.getStringValue())) {
        return false;
      }
    }
 else     if ((this.getValue().getValue() instanceof BooleanLiteral<?>) && (other.getValue().getValue() instanceof BooleanLiteral<?>)) {
      if (!this.getBooleanValue().equals(other.getBooleanValue())) {
        return false;
      }
    }
 else     if ((this.getValue().getValue() instanceof DoubleLiteral<?>) && (other.getValue().getValue() instanceof DoubleLiteral<?>)) {
      if (!this.getDoubleValue().equals(other.getDoubleValue())) {
        return false;
      }
    }
 else     if ((this.getValue().getValue() instanceof IntegerLiteral<?>) && (other.getValue().getValue() instanceof IntegerLiteral<?>)) {
      if (!this.getIntegerValue().equals(other.getIntegerValue())) {
        return false;
      }
    }
 else     if ((this.getValue().getValue() instanceof UriLiteral<?>) && (other.getValue().getValue() instanceof UriLiteral<?>)) {
      if (!this.getURIValue().equals(other.getURIValue())) {
        return false;
      }
    }
 else     if ((this.getValue().getValue() instanceof NestedDocument<?>) && (other.getValue().getValue() instanceof NestedDocument<?>)) {
      if (!this.getNestedQName().equals(other.getNestedQName())) {
        return false;
      }
      if (!this.getNestedIdentity().equals(other.getNestedIdentity())) {
        return false;
      }
      if (this.getAnnotations().size() != other.getAnnotations().size()) {
        return false;
      }
      for (      Annotation annotation1 : this.getAnnotations()) {
        boolean foundIt=false;
        for (        Annotation annotation2 : other.getAnnotations()) {
          if (annotation1.equals(annotation2)) {
            foundIt=true;
            break;
          }
        }
        if (foundIt == false)         break;
      }
    }
 else {
      return false;
    }
    return true;
  }
  return true;
}