Program: 35360
Project: 35360
Buggy source:
/** 
 * Returns the current contact model corresponding global export elements.<br> Only the following types of elements are returned: <ul> <li>  {@link ElementTypeEnum#DEFAULT_CONTACT}</li> <li>  {@link ElementTypeEnum#CHECKBOX}</li> <li>  {@link ElementTypeEnum#TEXT_AREA}</li> <li>  {@link ElementTypeEnum#TRIPLETS}</li> <li>  {@link ElementTypeEnum#QUESTION}</li> </ul>
 * @return The current contact model corresponding global export elements.
 */
public List<FlexibleElementDTO> getGlobalExportElements(){
  final List<FlexibleElementDTO> allElements=new ArrayList<FlexibleElementDTO>();
  final ContactDetailsDTO p=getDetails();
  p.setName();
  setDetails(p);
  if (getDetails().getLayout() != null) {
    for (    final LayoutGroupDTO lg : getDetails().getLayout().getGroups()) {
      for (      final LayoutConstraintDTO lc : lg.getConstraints()) {
        final FlexibleElementDTO element=lc.getFlexibleElementDTO();
        element.setGroup(lg);
        element.setConstraint(lc);
        element.setContainerModel(getDetails());
        final ElementTypeEnum type=element.getElementType();
        if (ElementTypeEnum.DEFAULT_CONTACT == type || ElementTypeEnum.CHECKBOX == type || ElementTypeEnum.TEXT_AREA == type || ElementTypeEnum.TRIPLETS == type || ElementTypeEnum.QUESTION == type || ElementTypeEnum.CONTACT_LIST == type) {
          allElements.add(element);
        }
      }
    }
  }
  return allElements;
}

Fixed version (ground truth):
/** 
 * Returns the current contact model corresponding global export elements.<br> Only the following types of elements are returned: <ul> <li>  {@link ElementTypeEnum#DEFAULT_CONTACT}</li> <li>  {@link ElementTypeEnum#CHECKBOX}</li> <li>  {@link ElementTypeEnum#TEXT_AREA}</li> <li>  {@link ElementTypeEnum#TRIPLETS}</li> <li>  {@link ElementTypeEnum#QUESTION}</li> </ul>
 * @return The current contact model corresponding global export elements.
 */
public List<FlexibleElementDTO> getGlobalExportElements(){
  final List<FlexibleElementDTO> allElements=new ArrayList<FlexibleElementDTO>();
  final ContactDetailsDTO p=getDetails();
  p.setName();
  setDetails(p);
  if (getDetails().getLayout() != null) {
    for (    final LayoutGroupDTO lg : getDetails().getLayout().getGroups()) {
      for (      final LayoutConstraintDTO lc : lg.getConstraints()) {
        final FlexibleElementDTO element=lc.getFlexibleElementDTO();
        element.setGroup(lg);
        element.setConstraint(lc);
        element.setContainerModel(getDetails());
        final ElementTypeEnum type=element.getElementType();
        if (element instanceof DefaultContactFlexibleElementDTO) {
          DefaultContactFlexibleElementDTO defaultElement=(DefaultContactFlexibleElementDTO)element;
          if (getType() == ContactModelType.INDIVIDUAL) {
switch (defaultElement.getType()) {
case ORGANIZATION_NAME:
              continue;
          }
        }
 else {
switch (defaultElement.getType()) {
case FAMILY_NAME:
case FIRST_NAME:
            continue;
        }
      }
    }
    if (ElementTypeEnum.DEFAULT_CONTACT == type || ElementTypeEnum.CHECKBOX == type || ElementTypeEnum.TEXT_AREA == type || ElementTypeEnum.TRIPLETS == type || ElementTypeEnum.QUESTION == type || ElementTypeEnum.CONTACT_LIST == type) {
      allElements.add(element);
    }
  }
}
}
return allElements;
}