Program: 35384
Project: 35384
Buggy source:
public String getSerializedValue(Contact contact){
switch (type) {
case COUNTRY:
    if (contact.getCountry() == null) {
      return null;
    }
  return String.valueOf(contact.getCountry().getId());
case CREATION_DATE:
return String.valueOf(contact.getDateCreated().getTime());
case DIRECT_MEMBERSHIP:
if (contact.getParent() == null) {
return null;
}
return String.valueOf(contact.getParent().getId());
case EMAIL_ADDRESS:
return contact.getEmail();
case FAMILY_NAME:
return contact.getName();
case FIRST_NAME:
return contact.getFirstname();
case LOGIN:
return contact.getLogin();
case MAIN_ORG_UNIT:
if (contact.getMainOrgUnit() == null) {
return null;
}
return String.valueOf(contact.getMainOrgUnit().getId());
case ORGANIZATION_NAME:
return contact.getName();
case PHONE_NUMBER:
return contact.getPhoneNumber();
case PHOTO:
return contact.getPhoto();
case POSTAL_ADDRESS:
return contact.getPostalAddress();
case SECONDARY_ORG_UNITS:
if (contact.getSecondaryOrgUnits() == null) {
return null;
}
StringBuilder stringBuilder=new StringBuilder();
for (int i=0; i < contact.getSecondaryOrgUnits().size(); i++) {
if (i != 0) {
stringBuilder.append(ValueResultUtils.DEFAULT_VALUE_SEPARATOR);
}
stringBuilder.append(contact.getSecondaryOrgUnits().get(i).getId());
}
return stringBuilder.toString();
case TOP_MEMBERSHIP:
if (contact.getRoot() == null) {
return null;
}
return String.valueOf(contact.getRoot().getId());
default :
throw new IllegalStateException("String_Node_Str" + getType());
}
}

Fixed version (ground truth):
public String getSerializedValue(Contact contact){
switch (type) {
case COUNTRY:
    if (contact.getCountry() == null) {
      return null;
    }
  return String.valueOf(contact.getCountry().getId());
case CREATION_DATE:
return String.valueOf(contact.getDateCreated().getTime());
case DIRECT_MEMBERSHIP:
if (contact.getParent() == null) {
return null;
}
return String.valueOf(contact.getParent().getId());
case EMAIL_ADDRESS:
return contact.getEmail();
case FAMILY_NAME:
if (contact.getContactModel().getType().equals(ContactModelType.INDIVIDUAL)) {
return contact.getName();
}
 else {
return null;
}
case FIRST_NAME:
return contact.getFirstname();
case LOGIN:
return contact.getLogin();
case MAIN_ORG_UNIT:
if (contact.getMainOrgUnit() == null) {
return null;
}
return String.valueOf(contact.getMainOrgUnit().getId());
case ORGANIZATION_NAME:
if (contact.getContactModel().getType().equals(ContactModelType.ORGANIZATION)) {
return contact.getName();
}
 else {
return null;
}
case PHONE_NUMBER:
return contact.getPhoneNumber();
case PHOTO:
return contact.getPhoto();
case POSTAL_ADDRESS:
return contact.getPostalAddress();
case SECONDARY_ORG_UNITS:
if (contact.getSecondaryOrgUnits() == null) {
return null;
}
StringBuilder stringBuilder=new StringBuilder();
for (int i=0; i < contact.getSecondaryOrgUnits().size(); i++) {
if (i != 0) {
stringBuilder.append(ValueResultUtils.DEFAULT_VALUE_SEPARATOR);
}
stringBuilder.append(contact.getSecondaryOrgUnits().get(i).getId());
}
return stringBuilder.toString();
case TOP_MEMBERSHIP:
if (contact.getRoot() == null) {
return null;
}
return String.valueOf(contact.getRoot().getId());
default :
throw new IllegalStateException("String_Node_Str" + getType());
}
}