Program: 148339
Project: 148339
Buggy source:
public Object[] getChildren(Object parent){
  if (parent == null) {
    System.out.println("String_Node_Str");
  }
  if (parent instanceof XSDSchema) {
    EList xsdElementDeclarations=xsdSchema.getElementDeclarations();
    List<XSDElementDeclaration> list=new ArrayList<XSDElementDeclaration>();
    if (filter != null && !filter.isAll()) {
      for (      XSDElementDeclaration el : (XSDElementDeclaration[])xsdElementDeclarations.toArray(new XSDElementDeclaration[xsdElementDeclarations.size()])) {
        if (isInclude(el.getAnnotation())) {
          list.add(el);
        }
      }
      return filterOutDuplicatedElems(list);
    }
    return filterOutDuplicatedElems(xsdElementDeclarations);
  }
  if (parent instanceof XSDAttributeGroupDefinition) {
    XSDAttributeGroupDefinition attributeGroupDefinition=(XSDAttributeGroupDefinition)parent;
    if (attributeGroupDefinition.getContents().size() == 0)     attributeGroupDefinition=attributeGroupDefinition.getResolvedAttributeGroupDefinition();
    return attributeGroupDefinition.getContents().toArray(new Object[attributeGroupDefinition.getContents().size()]);
  }
  if (parent instanceof XSDParticle) {
    XSDParticle xsdParticle=(XSDParticle)parent;
    return getXSDParticleChildren(xsdParticle);
  }
  if (parent instanceof XSDModelGroup) {
    XSDModelGroup modelGroup=((XSDModelGroup)parent);
    EList list=modelGroup.getContents();
    List<XSDParticle> ls=new ArrayList<XSDParticle>();
    if (filter != null && !filter.isAll()) {
      for (      XSDParticle el : (XSDParticle[])list.toArray(new XSDParticle[list.size()])) {
        XSDTerm tm=el.getTerm();
        if (tm instanceof XSDElementDeclaration) {
          XSDAnnotation annotation=((XSDElementDeclaration)tm).getAnnotation();
          if (isInclude(annotation)) {
            ls.add(el);
          }
        }
      }
      return ls.toArray(new XSDParticle[ls.size()]);
    }
    return list.toArray(new Object[list.size()]);
  }
  if (parent instanceof XSDSimpleTypeDefinition) {
    XSDSimpleTypeDefinition std=(XSDSimpleTypeDefinition)parent;
    if (std.getVariety().equals(XSDVariety.ATOMIC_LITERAL)) {
      ArrayList list=new ArrayList();
      if (std != null && std.getSchema() != null && std.getSchema().getSchemaForSchema() != null)       if (!std.getSchema().getSchemaForSchema().getTypeDefinitions().contains(std))       list.add(std.getBaseTypeDefinition());
      list.addAll(std.getFacetContents());
      return list.toArray(new Object[list.size()]);
    }
    if (std.getVariety().equals(XSDVariety.LIST_LITERAL)) {
      return new XSDSimpleTypeDefinition[]{std.getBaseTypeDefinition()};
    }
    if (std.getVariety().equals(XSDVariety.UNION_LITERAL))     return std.getMemberTypeDefinitions().toArray(new XSDSimpleTypeDefinition[std.getMemberTypeDefinitions().size()]);
  }
  if (parent instanceof XSDElementDeclaration) {
    if (((XSDElementDeclaration)parent).isAbstract())     return new Object[0];
    ArrayList<Object> list=new ArrayList<Object>();
    XSDTypeDefinition typeDefinition=((XSDElementDeclaration)parent).getTypeDefinition();
    if (typeDefinition instanceof XSDComplexTypeDefinition) {
      list.addAll(Util.getComplexTypeDefinitionChildren((XSDComplexTypeDefinition)typeDefinition));
    }
 else {
      list.add(((XSDElementDeclaration)parent).getTypeDefinition());
    }
    if (filter != null && !filter.isAll()) {
    }
 else {
      list.addAll(((XSDElementDeclaration)parent).getIdentityConstraintDefinitions());
    }
    XSDAnnotation annotation=((XSDElementDeclaration)parent).getAnnotation();
    if (filter != null && !filter.isAll()) {
    }
 else {
      if (annotation != null) {
        list.add(annotation);
      }
    }
    return list.toArray(new Object[list.size()]);
  }
  if (parent instanceof XSDIdentityConstraintDefinition) {
    ArrayList list=new ArrayList();
    if (filter != null && !filter.isAll()) {
    }
 else {
      list.add(((XSDIdentityConstraintDefinition)parent).getSelector());
      list.addAll(((XSDIdentityConstraintDefinition)parent).getFields());
    }
    return list.toArray(new Object[list.size()]);
  }
  if (parent instanceof XSDAnnotation) {
    ArrayList list=new ArrayList();
    if (filter != null && !filter.isAll()) {
    }
 else {
      XSDAnnotation annotation=(XSDAnnotation)parent;
      list.addAll(annotation.getUserInformation());
      list.addAll(annotation.getApplicationInformation());
    }
    return list.size() == 0 ? new Object[0] : list.toArray(new Object[list.size()]);
  }
  if (parent instanceof Element) {
    return new Object[0];
  }
  return new Object[0];
}

Fixed version (ground truth):
public Object[] getChildren(Object parent){
  if (parent == null) {
    log.info("String_Node_Str");
  }
  if (parent instanceof XSDSchema) {
    EList xsdElementDeclarations=xsdSchema.getElementDeclarations();
    List<XSDElementDeclaration> list=new ArrayList<XSDElementDeclaration>();
    if (filter != null && !filter.isAll()) {
      for (      XSDElementDeclaration el : (XSDElementDeclaration[])xsdElementDeclarations.toArray(new XSDElementDeclaration[xsdElementDeclarations.size()])) {
        if (isInclude(el.getAnnotation())) {
          list.add(el);
        }
      }
      return filterOutDuplicatedElems(list);
    }
    return filterOutDuplicatedElems(xsdElementDeclarations);
  }
  if (parent instanceof XSDAttributeGroupDefinition) {
    XSDAttributeGroupDefinition attributeGroupDefinition=(XSDAttributeGroupDefinition)parent;
    if (attributeGroupDefinition.getContents().size() == 0)     attributeGroupDefinition=attributeGroupDefinition.getResolvedAttributeGroupDefinition();
    return attributeGroupDefinition.getContents().toArray(new Object[attributeGroupDefinition.getContents().size()]);
  }
  if (parent instanceof XSDParticle) {
    XSDParticle xsdParticle=(XSDParticle)parent;
    return getXSDParticleChildren(xsdParticle);
  }
  if (parent instanceof XSDModelGroup) {
    XSDModelGroup modelGroup=((XSDModelGroup)parent);
    EList list=modelGroup.getContents();
    List<XSDParticle> ls=new ArrayList<XSDParticle>();
    if (filter != null && !filter.isAll()) {
      for (      XSDParticle el : (XSDParticle[])list.toArray(new XSDParticle[list.size()])) {
        XSDTerm tm=el.getTerm();
        if (tm instanceof XSDElementDeclaration) {
          XSDAnnotation annotation=((XSDElementDeclaration)tm).getAnnotation();
          if (isInclude(annotation)) {
            ls.add(el);
          }
        }
      }
      return ls.toArray(new XSDParticle[ls.size()]);
    }
    return list.toArray(new Object[list.size()]);
  }
  if (parent instanceof XSDSimpleTypeDefinition) {
    XSDSimpleTypeDefinition std=(XSDSimpleTypeDefinition)parent;
    if (std.getVariety().equals(XSDVariety.ATOMIC_LITERAL)) {
      ArrayList list=new ArrayList();
      if (std != null && std.getSchema() != null && std.getSchema().getSchemaForSchema() != null)       if (!std.getSchema().getSchemaForSchema().getTypeDefinitions().contains(std))       list.add(std.getBaseTypeDefinition());
      list.addAll(std.getFacetContents());
      return list.toArray(new Object[list.size()]);
    }
    if (std.getVariety().equals(XSDVariety.LIST_LITERAL)) {
      return new XSDSimpleTypeDefinition[]{std.getBaseTypeDefinition()};
    }
    if (std.getVariety().equals(XSDVariety.UNION_LITERAL))     return std.getMemberTypeDefinitions().toArray(new XSDSimpleTypeDefinition[std.getMemberTypeDefinitions().size()]);
  }
  if (parent instanceof XSDElementDeclaration) {
    if (((XSDElementDeclaration)parent).isAbstract())     return new Object[0];
    ArrayList<Object> list=new ArrayList<Object>();
    XSDTypeDefinition typeDefinition=((XSDElementDeclaration)parent).getTypeDefinition();
    if (typeDefinition instanceof XSDComplexTypeDefinition) {
      list.addAll(Util.getComplexTypeDefinitionChildren((XSDComplexTypeDefinition)typeDefinition));
    }
 else {
      list.add(((XSDElementDeclaration)parent).getTypeDefinition());
    }
    if (filter != null && !filter.isAll()) {
    }
 else {
      list.addAll(((XSDElementDeclaration)parent).getIdentityConstraintDefinitions());
    }
    XSDAnnotation annotation=((XSDElementDeclaration)parent).getAnnotation();
    if (filter != null && !filter.isAll()) {
    }
 else {
      if (annotation != null) {
        list.add(annotation);
      }
    }
    return list.toArray(new Object[list.size()]);
  }
  if (parent instanceof XSDIdentityConstraintDefinition) {
    ArrayList list=new ArrayList();
    if (filter != null && !filter.isAll()) {
    }
 else {
      list.add(((XSDIdentityConstraintDefinition)parent).getSelector());
      list.addAll(((XSDIdentityConstraintDefinition)parent).getFields());
    }
    return list.toArray(new Object[list.size()]);
  }
  if (parent instanceof XSDAnnotation) {
    ArrayList list=new ArrayList();
    if (filter != null && !filter.isAll()) {
    }
 else {
      XSDAnnotation annotation=(XSDAnnotation)parent;
      list.addAll(annotation.getUserInformation());
      list.addAll(annotation.getApplicationInformation());
    }
    return list.size() == 0 ? new Object[0] : list.toArray(new Object[list.size()]);
  }
  if (parent instanceof Element) {
    return new Object[0];
  }
  return new Object[0];
}