Program: 163834
Project: 163834
Buggy source:
protected static List<ContentValues> getValuesForPostalAddresses(VCard vCard){
  List<ContentValues> valuesList=new LinkedList<ContentValues>();
  for (  ezvcard.property.Address address : vCard.getAddresses()) {
    ContentValues values=new ContentValues();
    values.put(ContactsContract.Data.MIMETYPE,ContactsContract.CommonDataKinds.StructuredPostal.CONTENT_ITEM_TYPE);
    if (address.getTypes().contains(AddressType.HOME))     values.put(ContactsContract.CommonDataKinds.StructuredPostal.TYPE,ContactsContract.CommonDataKinds.StructuredPostal.TYPE_HOME);
 else     if (address.getTypes().contains(AddressType.WORK))     values.put(ContactsContract.CommonDataKinds.StructuredPostal.TYPE,ContactsContract.CommonDataKinds.StructuredPostal.TYPE_WORK);
 else     if (!address.getTypes().isEmpty()) {
      values.put(ContactsContract.CommonDataKinds.StructuredPostal.TYPE,ContactsContract.CommonDataKinds.StructuredPostal.TYPE_CUSTOM);
      values.put(ContactsContract.CommonDataKinds.StructuredPostal.LABEL,propertyNameToLabel(address.getTypes().iterator().next().getValue()));
    }
 else     values.put(ContactsContract.CommonDataKinds.StructuredPostal.TYPE,ContactsContract.CommonDataKinds.StructuredPostal.TYPE_OTHER);
    String formattedAddress=address.getLabel();
    if (StringUtils.isEmpty(address.getLabel())) {
      String lineStreet=StringUtils.join(new String[]{address.getStreetAddress(),address.getPoBox(),address.getExtendedAddress()},"String_Node_Str");
      String lineLocality=StringUtils.join(new String[]{address.getPostalCode(),address.getLocality()},"String_Node_Str");
      List<String> lines=new LinkedList<String>();
      if (lineStreet != null)       lines.add(lineStreet);
      if (address.getRegion() != null && !address.getRegion().isEmpty())       lines.add(address.getRegion());
      if (lineLocality != null)       lines.add(lineLocality);
      formattedAddress=StringUtils.join(lines,"String_Node_Str");
    }
    values.put(ContactsContract.CommonDataKinds.StructuredPostal.FORMATTED_ADDRESS,formattedAddress);
    values.put(ContactsContract.CommonDataKinds.StructuredPostal.STREET,address.getStreetAddress());
    values.put(ContactsContract.CommonDataKinds.StructuredPostal.POBOX,address.getPoBox());
    values.put(ContactsContract.CommonDataKinds.StructuredPostal.NEIGHBORHOOD,address.getExtendedAddress());
    values.put(ContactsContract.CommonDataKinds.StructuredPostal.CITY,address.getLocality());
    values.put(ContactsContract.CommonDataKinds.StructuredPostal.REGION,address.getRegion());
    values.put(ContactsContract.CommonDataKinds.StructuredPostal.POSTCODE,address.getPostalCode());
    values.put(ContactsContract.CommonDataKinds.StructuredPostal.COUNTRY,address.getCountry());
    valuesList.add(values);
  }
  return valuesList;
}

Fixed version (ground truth):
protected static List<ContentValues> getValuesForPostalAddresses(VCard vCard){
  List<ContentValues> valuesList=new LinkedList<ContentValues>();
  for (  ezvcard.property.Address address : vCard.getAddresses()) {
    ContentValues values=new ContentValues();
    values.put(ContactsContract.Data.MIMETYPE,ContactsContract.CommonDataKinds.StructuredPostal.CONTENT_ITEM_TYPE);
    if (address.getTypes().contains(AddressType.HOME))     values.put(ContactsContract.CommonDataKinds.StructuredPostal.TYPE,ContactsContract.CommonDataKinds.StructuredPostal.TYPE_HOME);
 else     if (address.getTypes().contains(AddressType.WORK))     values.put(ContactsContract.CommonDataKinds.StructuredPostal.TYPE,ContactsContract.CommonDataKinds.StructuredPostal.TYPE_WORK);
 else     if (!address.getTypes().isEmpty()) {
      values.put(ContactsContract.CommonDataKinds.StructuredPostal.TYPE,ContactsContract.CommonDataKinds.StructuredPostal.TYPE_CUSTOM);
      values.put(ContactsContract.CommonDataKinds.StructuredPostal.LABEL,propertyNameToLabel(address.getTypes().iterator().next().getValue()));
    }
 else     values.put(ContactsContract.CommonDataKinds.StructuredPostal.TYPE,ContactsContract.CommonDataKinds.StructuredPostal.TYPE_OTHER);
    if (address.getLabel() != null) {
      try {
        String formattedAddress=new String(Base64.decode(address.getLabel()));
        values.put(ContactsContract.CommonDataKinds.StructuredPostal.FORMATTED_ADDRESS,formattedAddress);
        values.put(ContactsContract.CommonDataKinds.StructuredPostal.STREET,address.getStreetAddress());
        values.put(ContactsContract.CommonDataKinds.StructuredPostal.POBOX,address.getPoBox());
        values.put(ContactsContract.CommonDataKinds.StructuredPostal.NEIGHBORHOOD,address.getExtendedAddress());
        values.put(ContactsContract.CommonDataKinds.StructuredPostal.CITY,address.getLocality());
        values.put(ContactsContract.CommonDataKinds.StructuredPostal.REGION,address.getRegion());
        values.put(ContactsContract.CommonDataKinds.StructuredPostal.POSTCODE,address.getPostalCode());
        values.put(ContactsContract.CommonDataKinds.StructuredPostal.COUNTRY,address.getCountry());
        valuesList.add(values);
      }
 catch (      IOException e) {
        Log.e(TAG,"String_Node_Str");
      }
    }
  }
  return valuesList;
}