Program: 147748
Project: 147748
Buggy source:
private boolean isSameXSDElement(Object objA,Object objB){
  if (objA != null && objB != null) {
    if (objA.getClass().getName().equals(objB.getClass().getName())) {
      if (objA instanceof XSDElementDeclaration) {
        XSDElementDeclaration declA=(XSDElementDeclaration)objA;
        XSDElementDeclaration declB=(XSDElementDeclaration)objB;
        if (declA.getName().equals(declB.getName()))         return true;
      }
 else       if (objA instanceof XSDModelGroup) {
        XSDModelGroup goupA=(XSDModelGroup)objA;
        XSDModelGroup goupB=(XSDModelGroup)objB;
        String nameA=getModelGroupName(goupA);
        String nameB=getModelGroupName(goupB);
        if (nameA == null && nameB == null)         return true;
        if (nameA != null && nameB != null && nameA.equals(nameB))         return true;
      }
 else       if (objA instanceof XSDModelGroupDefinition) {
        XSDModelGroupDefinition goupA=(XSDModelGroupDefinition)objA;
        XSDModelGroupDefinition goupB=(XSDModelGroupDefinition)objB;
        if (goupA.getName() == null && goupB.getName() == null)         return true;
        if (goupA.getName().equals(goupB.getName()))         return true;
      }
 else       if (objA instanceof XSDParticle) {
        XSDParticle particleA=(XSDParticle)objA;
        XSDParticle particleB=(XSDParticle)objB;
        if (particleA.getTerm() instanceof XSDElementDeclaration && particleB.getTerm() instanceof XSDElementDeclaration) {
          XSDElementDeclaration declA=(XSDElementDeclaration)particleA.getTerm();
          XSDElementDeclaration declB=(XSDElementDeclaration)particleB.getTerm();
          if (declA.getName().equals(declB.getName()))           return true;
        }
      }
 else       if (objA instanceof XSDAnnotation) {
        return true;
      }
 else       if (objA instanceof XSDIdentityConstraintDefinition) {
        XSDIdentityConstraintDefinition constraintA=(XSDIdentityConstraintDefinition)objA;
        XSDIdentityConstraintDefinition constraintB=(XSDIdentityConstraintDefinition)objA;
        if (constraintA.getName().equals(constraintB.getName()))         return true;
      }
 else       if (objA instanceof XSDSimpleTypeDefinition) {
        XSDSimpleTypeDefinition simpleDefineA=(XSDSimpleTypeDefinition)objA;
        XSDSimpleTypeDefinition simpleDefineB=(XSDSimpleTypeDefinition)objB;
        if (simpleDefineA.getName().equals(simpleDefineB.getName()))         return true;
      }
    }
  }
  return false;
}

Fixed version (ground truth):
private boolean isSameXSDElement(Object objA,ExpandInfoNode objB){
  if (objA != null && objB != null) {
    if (objA.getClass().getName().equals(objB.type)) {
      if (objA instanceof XSDElementDeclaration) {
        XSDElementDeclaration declA=(XSDElementDeclaration)objA;
        if (declA.getName().equals(objB.name))         return true;
      }
 else       if (objA instanceof XSDModelGroup) {
        XSDModelGroup goupA=(XSDModelGroup)objA;
        String nameA=getName(goupA);
        String nameB=objB.name;
        if (nameA == null && nameB == null)         return true;
        if (nameA != null && nameB != null && nameA.equals(nameB))         return true;
      }
 else       if (objA instanceof XSDModelGroupDefinition) {
        XSDModelGroupDefinition goupA=(XSDModelGroupDefinition)objA;
        if (goupA.getName() == null && objB.name == null)         return true;
        if (goupA.getName().equals(objB.name))         return true;
      }
 else       if (objA instanceof XSDParticle) {
        XSDParticle particleA=(XSDParticle)objA;
        if (particleA.getTerm() instanceof XSDElementDeclaration) {
          XSDElementDeclaration declA=(XSDElementDeclaration)particleA.getTerm();
          if (declA.getName().equals(objB.name))           return true;
        }
      }
 else       if (objA instanceof XSDAnnotation) {
        return true;
      }
 else       if (objA instanceof XSDIdentityConstraintDefinition) {
        XSDIdentityConstraintDefinition constraintA=(XSDIdentityConstraintDefinition)objA;
        if (constraintA.getName().equals(objB.name))         return true;
      }
 else       if (objA instanceof XSDSimpleTypeDefinition) {
        XSDSimpleTypeDefinition simpleDefineA=(XSDSimpleTypeDefinition)objA;
        if (simpleDefineA.getName() == null && objB.name == null)         return true;
        if (simpleDefineA.getName().equals(objB.name))         return true;
      }
 else       if (objA instanceof XSDComplexTypeDefinition) {
        XSDComplexTypeDefinition complexDefineA=(XSDComplexTypeDefinition)objA;
        if (complexDefineA.getName() == null && objB.name == null)         return true;
        if (complexDefineA.getName().equals(objB.name))         return true;
      }
    }
  }
  return false;
}