Skip to content

Commit

Permalink
re-privatize getRecipientForNumber
Browse files Browse the repository at this point in the history
  • Loading branch information
mcginty committed Feb 18, 2014
1 parent e15ff61 commit ca51dda
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,18 @@ public void onRecipientsPanelUpdate(Recipients recipients) {

private Recipients contactDataToRecipients(ContactData contactData) {
if (contactData == null || contactData.numbers == null) return null;
List<Recipient> recipients = new ArrayList<Recipient>();
Recipients recipients = new Recipients(new ArrayList<Recipient>());
for (ContactAccessor.NumberData numberData : contactData.numbers) {
if (NumberUtil.isValidSmsOrEmailOrGroup(numberData.number)) {
Recipient recipient = RecipientFactory.getRecipientForNumber(SingleContactSelectionActivity.this,
numberData.number,
false);
recipients.add(recipient);
try {
Recipients recipientsForNumber = RecipientFactory.getRecipientsFromString(SingleContactSelectionActivity.this,
numberData.number,
false);
recipients.getRecipientsList().addAll(recipientsForNumber.getRecipientsList());
} catch (RecipientFormattingException rfe) { }

This comment has been minimized.

Copy link
@moxie0

moxie0 Feb 18, 2014

Contributor

never ever ever ever ever ever ever ever ever ever ever ever catch an exception and leave the catch block empty. never.

This comment has been minimized.

Copy link
@mcginty

mcginty Feb 18, 2014

Author Contributor

yeah that was dumb of me, will add Log.w with the exception as a warning

}
}
return new Recipients(recipients);
return recipients;
}

private void openNewConversation(Recipients recipients) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public static Recipients getRecipientsForIds(Context context, String recipientId
return new Recipients(results);
}

public static Recipient getRecipientForNumber(Context context, String number, boolean asynchronous) {
private static Recipient getRecipientForNumber(Context context, String number, boolean asynchronous) {
long recipientId = CanonicalAddressDatabase.getInstance(context).getCanonicalAddress(number);
return provider.getRecipient(context, recipientId, asynchronous);
}
Expand Down

0 comments on commit ca51dda

Please sign in to comment.