cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From an-s...@apache.org
Subject cordova-plugin-contacts git commit: CB-10094 Android: Fixed empty string comparison
Date Mon, 30 Nov 2015 08:44:52 GMT
Repository: cordova-plugin-contacts
Updated Branches:
  refs/heads/master a4599c250 -> 4b3d9709c


CB-10094 Android: Fixed empty string comparison


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-contacts/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-contacts/commit/4b3d9709
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-contacts/tree/4b3d9709
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-contacts/diff/4b3d9709

Branch: refs/heads/master
Commit: 4b3d9709ca41b32cb34cbe0d9e4a7245ebcdf848
Parents: a4599c2
Author: Alexander Sorokin <alexander.sorokin@akvelon.com>
Authored: Fri Nov 27 16:49:22 2015 +0300
Committer: Alexander Sorokin <alexander.sorokin@akvelon.com>
Committed: Fri Nov 27 16:49:22 2015 +0300

----------------------------------------------------------------------
 src/android/ContactAccessorSdk5.java | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-contacts/blob/4b3d9709/src/android/ContactAccessorSdk5.java
----------------------------------------------------------------------
diff --git a/src/android/ContactAccessorSdk5.java b/src/android/ContactAccessorSdk5.java
index e232cfd..67014b3 100644
--- a/src/android/ContactAccessorSdk5.java
+++ b/src/android/ContactAccessorSdk5.java
@@ -52,11 +52,9 @@ import android.os.RemoteException;
 import android.provider.ContactsContract;
 import android.provider.ContactsContract.CommonDataKinds;
 import android.provider.ContactsContract.CommonDataKinds.Phone;
+import android.text.TextUtils;
 import android.util.Log;
 
-
-
-
 /**
  * An implementation of {@link ContactAccessor} that uses current Contacts API.
  * This class should be used on Eclair or beyond, but would not work on any earlier
@@ -824,19 +822,19 @@ public class ContactAccessorSdk5 extends ContactAccessor {
 
             // Create the formatted name
             StringBuffer formatted = new StringBuffer("");
-            if (honorificPrefix != null) {
+            if (!TextUtils.isEmpty(honorificPrefix)) {
                 formatted.append(honorificPrefix + " ");
             }
-            if (givenName != null) {
+            if (!TextUtils.isEmpty(givenName)) {
                 formatted.append(givenName + " ");
             }
-            if (middleName != null) {
+            if (!TextUtils.isEmpty(middleName)) {
                 formatted.append(middleName + " ");
             }
-            if (familyName != null) {
+            if (!TextUtils.isEmpty(familyName)) {
                 formatted.append(familyName);
             }
-            if (honorificSuffix != null) {
+            if (!TextUtils.isEmpty(honorificSuffix)) {
                 formatted.append(" " + honorificSuffix);
             }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message