Address file clean-up

This commit is contained in:
Philip Whitehouse 2017-01-29 11:27:20 +00:00
parent 14b1c0c439
commit 5a51523cc9

View file

@ -84,7 +84,7 @@ public class Address implements Serializable {
return null;
}
return mAddress.substring(hostIdx+1);
return mAddress.substring(hostIdx + 1);
}
public void setAddress(String address) {
@ -95,7 +95,8 @@ public class Address implements Serializable {
return mPersonal;
}
public void setPersonal(String personal) {
public void setPersonal(String newPersonal) {
String personal = newPersonal;
if ("".equals(personal)) {
personal = null;
}
@ -144,7 +145,7 @@ public class Address implements Serializable {
for (int i = 0, count = parsedList.size(); i < count; i++) {
org.apache.james.mime4j.dom.address.Address address = parsedList.get(i);
if (address instanceof Mailbox) {
Mailbox mailbox = (Mailbox)address;
Mailbox mailbox = (Mailbox) address;
addresses.add(new Address(mailbox.getLocalPart() + "@" + mailbox.getDomain(), mailbox.getName(), false));
} else {
Log.e(LOG_TAG, "Unknown address type from Mime4J: "
@ -309,8 +310,9 @@ public class Address implements Serializable {
}
/**
* Ensures that the given string starts and ends with the double quote character. The string is not modified in any way except to add the
* double quote character to start and end if it's not already there.
* Ensures that the given string starts and ends with the double quote character.
* The string is not modified in any way except to add the double quote character to start
* and end if it's not already there.
* sample -> "sample"
* "sample" -> "sample"
* ""sample"" -> ""sample""