Bug 1081281: Don't double-box in ContactService. r=rnewman
--- a/mobile/android/base/ContactService.java
+++ b/mobile/android/base/ContactService.java
@@ -1893,33 +1893,33 @@ public class ContactService implements G
mMimeTypeConstantsMap.put("sex", MIMETYPE_SEX);
mMimeTypeConstantsMap.put("genderidentity", MIMETYPE_GENDER_IDENTITY);
mMimeTypeConstantsMap.put("key", MIMETYPE_KEY);
}
private int getAddressType(String addressType) {
initAddressTypesMap();
Integer type = mAddressTypesMap.get(addressType.toLowerCase());
- return (type != null ? Integer.valueOf(type) : StructuredPostal.TYPE_CUSTOM);
+ return type != null ? type : StructuredPostal.TYPE_CUSTOM;
}
private void initAddressTypesMap() {
if (mAddressTypesMap != null) {
return;
}
mAddressTypesMap = new HashMap<String, Integer>();
mAddressTypesMap.put("home", StructuredPostal.TYPE_HOME);
mAddressTypesMap.put("work", StructuredPostal.TYPE_WORK);
}
private int getPhoneType(String phoneType) {
initPhoneTypesMap();
Integer type = mPhoneTypesMap.get(phoneType.toLowerCase());
- return (type != null ? Integer.valueOf(type) : Phone.TYPE_CUSTOM);
+ return type != null ? type : Phone.TYPE_CUSTOM;
}
private void initPhoneTypesMap() {
if (mPhoneTypesMap != null) {
return;
}
mPhoneTypesMap = new HashMap<String, Integer>();
@@ -1944,34 +1944,34 @@ public class ContactService implements G
mPhoneTypesMap.put("work pager", Phone.TYPE_WORK_PAGER);
mPhoneTypesMap.put("assistant", Phone.TYPE_ASSISTANT);
mPhoneTypesMap.put("mms", Phone.TYPE_MMS);
}
private int getEmailType(String emailType) {
initEmailTypesMap();
Integer type = mEmailTypesMap.get(emailType.toLowerCase());
- return (type != null ? Integer.valueOf(type) : Email.TYPE_CUSTOM);
+ return type != null ? type : Email.TYPE_CUSTOM;
}
private void initEmailTypesMap() {
if (mEmailTypesMap != null) {
return;
}
mEmailTypesMap = new HashMap<String, Integer>();
mEmailTypesMap.put("home", Email.TYPE_HOME);
mEmailTypesMap.put("mobile", Email.TYPE_MOBILE);
mEmailTypesMap.put("work", Email.TYPE_WORK);
}
private int getWebsiteType(String webisteType) {
initWebsiteTypesMap();
Integer type = mWebsiteTypesMap.get(webisteType.toLowerCase());
- return (type != null ? Integer.valueOf(type) : Website.TYPE_CUSTOM);
+ return type != null ? type : Website.TYPE_CUSTOM;
}
private void initWebsiteTypesMap() {
if (mWebsiteTypesMap != null) {
return;
}
mWebsiteTypesMap = new HashMap<String, Integer>();
@@ -1981,17 +1981,17 @@ public class ContactService implements G
mWebsiteTypesMap.put("home", Website.TYPE_HOME);
mWebsiteTypesMap.put("work", Website.TYPE_WORK);
mWebsiteTypesMap.put("ftp", Website.TYPE_FTP);
}
private int getImType(String imType) {
initImTypesMap();
Integer type = mImTypesMap.get(imType.toLowerCase());
- return (type != null ? Integer.valueOf(type) : Im.TYPE_CUSTOM);
+ return type != null ? type : Im.TYPE_CUSTOM;
}
private void initImTypesMap() {
if (mImTypesMap != null) {
return;
}
mImTypesMap = new HashMap<String, Integer>();