Program: 163835
Project: 163835
Buggy source:
protected static void addPostalAddress(String path,VCard vCard,ContentValues addressValues) throws InvalidComponentException {
  Integer addressType=addressValues.getAsInteger(ContactsContract.CommonDataKinds.StructuredPostal.TYPE);
  String formattedAddress=addressValues.getAsString(ContactsContract.CommonDataKinds.StructuredPostal.FORMATTED_ADDRESS);
  String label=addressValues.getAsString(ContactsContract.CommonDataKinds.StructuredPostal.LABEL);
  String street=addressValues.getAsString(ContactsContract.CommonDataKinds.StructuredPostal.STREET);
  String poBox=addressValues.getAsString(ContactsContract.CommonDataKinds.StructuredPostal.POBOX);
  String neighborhood=addressValues.getAsString(ContactsContract.CommonDataKinds.StructuredPostal.NEIGHBORHOOD);
  String city=addressValues.getAsString(ContactsContract.CommonDataKinds.StructuredPostal.CITY);
  String region=addressValues.getAsString(ContactsContract.CommonDataKinds.StructuredPostal.REGION);
  String postcode=addressValues.getAsString(ContactsContract.CommonDataKinds.StructuredPostal.POBOX);
  String country=addressValues.getAsString(ContactsContract.CommonDataKinds.StructuredPostal.COUNTRY);
  if (addressType != null && formattedAddress != null) {
    Address address=new Address();
    address.setLabel(formattedAddress);
switch (addressType) {
case ContactsContract.CommonDataKinds.StructuredPostal.TYPE_HOME:
      address.addType(AddressType.HOME);
    break;
case ContactsContract.CommonDataKinds.StructuredPostal.TYPE_WORK:
  address.addType(AddressType.WORK);
break;
case ContactsContract.CommonDataKinds.StructuredPostal.TYPE_CUSTOM:
if (label != null) AddressType.get(label);
break;
}
if (street != null) address.setStreetAddress(street);
if (poBox != null) address.setPoBox(poBox);
if (neighborhood != null) address.setExtendedAddress(neighborhood);
if (city != null) address.setLocality(city);
if (region != null) address.setRegion(region);
if (postcode != null) address.setPostalCode(postcode);
if (country != null) address.setCountry(country);
vCard.addAddress(address);
}
 else {
Log.e(TAG,"String_Node_Str");
throw new InvalidComponentException("String_Node_Str",false,CardDavConstants.CARDDAV_NAMESPACE,path);
}
}

Fixed version (ground truth):
protected static void addPostalAddress(String path,VCard vCard,ContentValues addressValues) throws InvalidComponentException {
  Integer addressType=addressValues.getAsInteger(ContactsContract.CommonDataKinds.StructuredPostal.TYPE);
  String formattedAddress=addressValues.getAsString(ContactsContract.CommonDataKinds.StructuredPostal.FORMATTED_ADDRESS);
  String label=addressValues.getAsString(ContactsContract.CommonDataKinds.StructuredPostal.LABEL);
  String street=addressValues.getAsString(ContactsContract.CommonDataKinds.StructuredPostal.STREET);
  String poBox=addressValues.getAsString(ContactsContract.CommonDataKinds.StructuredPostal.POBOX);
  String neighborhood=addressValues.getAsString(ContactsContract.CommonDataKinds.StructuredPostal.NEIGHBORHOOD);
  String city=addressValues.getAsString(ContactsContract.CommonDataKinds.StructuredPostal.CITY);
  String region=addressValues.getAsString(ContactsContract.CommonDataKinds.StructuredPostal.REGION);
  String postcode=addressValues.getAsString(ContactsContract.CommonDataKinds.StructuredPostal.POBOX);
  String country=addressValues.getAsString(ContactsContract.CommonDataKinds.StructuredPostal.COUNTRY);
  if (addressType != null && formattedAddress != null) {
    Address address=new Address();
    address.setLabel(Base64.encodeBytes(formattedAddress.getBytes()));
switch (addressType) {
case ContactsContract.CommonDataKinds.StructuredPostal.TYPE_HOME:
      address.addType(AddressType.HOME);
    break;
case ContactsContract.CommonDataKinds.StructuredPostal.TYPE_WORK:
  address.addType(AddressType.WORK);
break;
case ContactsContract.CommonDataKinds.StructuredPostal.TYPE_CUSTOM:
if (label != null) AddressType.get(label);
break;
}
if (street != null) address.setStreetAddress(street);
if (poBox != null) address.setPoBox(poBox);
if (neighborhood != null) address.setExtendedAddress(neighborhood);
if (city != null) address.setLocality(city);
if (region != null) address.setRegion(region);
if (postcode != null) address.setPostalCode(postcode);
if (country != null) address.setCountry(country);
vCard.addAddress(address);
}
 else {
Log.e(TAG,"String_Node_Str");
throw new InvalidComponentException("String_Node_Str",false,CardDavConstants.CARDDAV_NAMESPACE,path);
}
}