Avoid another possible NPE. Adjust obfuscation to produce less ambiguous mappings

git-svn-id: https://zxing.googlecode.com/svn/trunk@2272 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
srowen 2012-04-27 11:17:11 +00:00
parent 3e2dce9bd7
commit 7825e5bb49
2 changed files with 12 additions and 3 deletions

View file

@ -2,6 +2,9 @@
-dontskipnonpubliclibraryclasses -dontskipnonpubliclibraryclasses
-verbose -verbose
# Added:
-useuniqueclassmembernames
-dontpreverify -dontpreverify
-optimizations !class/merging/* -optimizations !class/merging/*

View file

@ -231,7 +231,9 @@ public final class ShareActivity extends Activity {
int phonesNumberColumn = phonesCursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER); int phonesNumberColumn = phonesCursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER);
while (phonesCursor.moveToNext() && foundPhone < Contents.PHONE_KEYS.length) { while (phonesCursor.moveToNext() && foundPhone < Contents.PHONE_KEYS.length) {
String number = phonesCursor.getString(phonesNumberColumn); String number = phonesCursor.getString(phonesNumberColumn);
bundle.putString(Contents.PHONE_KEYS[foundPhone], massageContactData(number)); if (number != null && number.length() > 0) {
bundle.putString(Contents.PHONE_KEYS[foundPhone], massageContactData(number));
}
foundPhone++; foundPhone++;
} }
} finally { } finally {
@ -250,7 +252,9 @@ public final class ShareActivity extends Activity {
if (methodsCursor.moveToNext()) { if (methodsCursor.moveToNext()) {
String data = methodsCursor.getString( String data = methodsCursor.getString(
methodsCursor.getColumnIndex(ContactsContract.CommonDataKinds.StructuredPostal.FORMATTED_ADDRESS)); methodsCursor.getColumnIndex(ContactsContract.CommonDataKinds.StructuredPostal.FORMATTED_ADDRESS));
bundle.putString(ContactsContract.Intents.Insert.POSTAL, massageContactData(data)); if (data != null && data.length() > 0) {
bundle.putString(ContactsContract.Intents.Insert.POSTAL, massageContactData(data));
}
} }
} finally { } finally {
methodsCursor.close(); methodsCursor.close();
@ -268,7 +272,9 @@ public final class ShareActivity extends Activity {
int emailColumn = emailCursor.getColumnIndex(ContactsContract.CommonDataKinds.Email.DATA); int emailColumn = emailCursor.getColumnIndex(ContactsContract.CommonDataKinds.Email.DATA);
while (emailCursor.moveToNext() && foundEmail < Contents.EMAIL_KEYS.length) { while (emailCursor.moveToNext() && foundEmail < Contents.EMAIL_KEYS.length) {
String email = emailCursor.getString(emailColumn); String email = emailCursor.getString(emailColumn);
bundle.putString(Contents.EMAIL_KEYS[foundEmail], massageContactData(email)); if (email != null && email.length() > 0) {
bundle.putString(Contents.EMAIL_KEYS[foundEmail], massageContactData(email));
}
foundEmail++; foundEmail++;
} }
} finally { } finally {