Program: 96374
Project: 96374
Buggy source:
/** 
 * {@inheritDoc}
 */
public Object[] getChildren(Object parentElement){
  if (parentElement instanceof IObjectMappingPO) {
    IObjectMappingPO mapping=(IObjectMappingPO)parentElement;
    List<IObjectMappingCategoryPO> categoryList=new ArrayList<IObjectMappingCategoryPO>();
    categoryList.add(mapping.getMappedCategory());
    categoryList.add(mapping.getUnmappedLogicalCategory());
    categoryList.add(mapping.getUnmappedTechnicalCategory());
    Validate.noNullElements(categoryList);
    return categoryList.toArray();
  }
  if (parentElement instanceof IObjectMappingAssoziationPO) {
    IObjectMappingAssoziationPO assoc=(IObjectMappingAssoziationPO)parentElement;
    List<String> componentNameGuidList=assoc.getLogicalNames();
    List<Object> componentNamePoList=new ArrayList<Object>();
    for (    String compNameGuid : componentNameGuidList) {
      IComponentNamePO compNamePo=m_compNameMapper.getCompNameCache().getCompNamePo(compNameGuid);
      if (compNamePo != null) {
        componentNamePoList.add(compNamePo);
        m_childToParentMap.put(compNamePo,parentElement);
      }
 else {
        componentNamePoList.add(compNameGuid);
        m_childToParentMap.put(compNamePo,parentElement);
      }
    }
    Validate.noNullElements(componentNamePoList);
    return componentNamePoList.toArray();
  }
  if (parentElement instanceof IComponentNamePO) {
    return new Object[0];
  }
  if (parentElement instanceof IObjectMappingCategoryPO) {
    List<Object> childList=new ArrayList<Object>();
    IObjectMappingCategoryPO category=(IObjectMappingCategoryPO)parentElement;
    childList.addAll(category.getUnmodifiableCategoryList());
    for (    IObjectMappingAssoziationPO assoc : category.getUnmodifiableAssociationList()) {
      if (assoc.getTechnicalName() != null) {
        childList.add(assoc);
      }
 else {
        for (        String compNameGuid : assoc.getLogicalNames()) {
          IComponentNamePO compName=m_compNameMapper.getCompNameCache().getCompNamePo(compNameGuid);
          if (compName != null) {
            childList.add(compName);
          }
 else {
            childList.add(compNameGuid);
          }
        }
      }
    }
    for (    Object child : childList) {
      m_childToParentMap.put(child,parentElement);
    }
    Validate.noNullElements(childList);
    return childList.toArray();
  }
 else   if (parentElement instanceof String) {
    return new Object[0];
  }
  Assert.notReached(Messages.WrongTypeOfElement + StringConstants.EXCLAMATION_MARK);
  return new Object[0];
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public Object[] getChildren(Object parentElement){
  if (parentElement instanceof IObjectMappingPO) {
    IObjectMappingPO mapping=(IObjectMappingPO)parentElement;
    List<IObjectMappingCategoryPO> categoryList=new ArrayList<IObjectMappingCategoryPO>();
    categoryList.add(mapping.getMappedCategory());
    categoryList.add(mapping.getUnmappedLogicalCategory());
    categoryList.add(mapping.getUnmappedTechnicalCategory());
    Validate.noNullElements(categoryList);
    return categoryList.toArray();
  }
  if (parentElement instanceof IObjectMappingAssoziationPO) {
    IObjectMappingAssoziationPO assoc=(IObjectMappingAssoziationPO)parentElement;
    List<String> componentNameGuidList=assoc.getLogicalNames();
    List<Object> componentNamePoList=new ArrayList<Object>();
    for (    String compNameGuid : componentNameGuidList) {
      IComponentNamePO compNamePo=m_compNameMapper.getCompNameCache().getCompNamePo(compNameGuid);
      if (compNamePo != null) {
        componentNamePoList.add(compNamePo);
        m_childToParentMap.put(compNamePo,parentElement);
      }
 else {
        componentNamePoList.add(compNameGuid);
        m_childToParentMap.put(compNamePo,parentElement);
      }
    }
    Validate.noNullElements(componentNamePoList);
    return componentNamePoList.toArray();
  }
  if (parentElement instanceof IComponentNamePO) {
    return new Object[0];
  }
  if (parentElement instanceof IObjectMappingCategoryPO) {
    List<Object> childList=new ArrayList<Object>();
    IObjectMappingCategoryPO category=(IObjectMappingCategoryPO)parentElement;
    childList.addAll(category.getUnmodifiableCategoryList());
    for (    IObjectMappingAssoziationPO assoc : category.getUnmodifiableAssociationList()) {
      if (assoc.getTechnicalName() != null) {
        childList.add(assoc);
      }
 else {
        for (        String compNameGuid : assoc.getLogicalNames()) {
          IComponentNamePO compName=m_compNameMapper.getCompNameCache().getCompNamePo(compNameGuid);
          if (compName != null) {
            childList.add(compName);
          }
        }
      }
    }
    for (    Object child : childList) {
      m_childToParentMap.put(child,parentElement);
    }
    Validate.noNullElements(childList);
    return childList.toArray();
  }
 else   if (parentElement instanceof String) {
    return new Object[0];
  }
  Assert.notReached(Messages.WrongTypeOfElement + StringConstants.EXCLAMATION_MARK);
  return new Object[0];
}