am 29491840: Merge "Cleanup: Add @Override" into froyo-plus-aosp

Merge commit '29491840e62a3a21a9b8e4a0889450d2d0875255' into kraken

* commit '29491840e62a3a21a9b8e4a0889450d2d0875255':
  Cleanup: Add @Override
This commit is contained in:
Makoto Onuki 2010-05-10 11:30:36 -07:00 committed by Android Git Automerger
commit d93f323faa
10 changed files with 46 additions and 0 deletions

View File

@ -69,6 +69,7 @@ public class FixedLengthInputStream extends InputStream {
return read(b, 0, b.length);
}
@Override
public String toString() {
return String.format("FixedLengthInputStream(in=%s, length=%d)", mIn.toString(), mLength);
}

View File

@ -72,6 +72,7 @@ public class PeekableInputStream extends InputStream {
return read(b, 0, b.length);
}
@Override
public String toString() {
return String.format("PeekableInputStream(in=%s, peeked=%b, peekedByte=%d)",
mIn.toString(), mPeeked, mPeekedByte);

View File

@ -198,6 +198,7 @@ public class Address {
*
* @return Human readable address string. Not quoted and not encoded.
*/
@Override
public String toString() {
if (mPersonal != null) {
if (mPersonal.matches(".*[\\(\\)<>@,;:\\\\\".\\[\\]].*")) {

View File

@ -159,6 +159,7 @@ public class PackedString {
/**
* Pack the values and return a single, encoded string
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
for (Map.Entry<String,String> entry : mMap.entrySet()) {

View File

@ -147,10 +147,12 @@ public class MimeMessage extends Message {
return mHeader;
}
@Override
public Date getReceivedDate() throws MessagingException {
return null;
}
@Override
public Date getSentDate() throws MessagingException {
if (mSentDate == null) {
try {
@ -164,11 +166,13 @@ public class MimeMessage extends Message {
return mSentDate;
}
@Override
public void setSentDate(Date sentDate) throws MessagingException {
setHeader("Date", DATE_FORMAT.format(sentDate));
this.mSentDate = sentDate;
}
@Override
public String getContentType() throws MessagingException {
String contentType = getFirstHeader(MimeHeader.HEADER_CONTENT_TYPE);
if (contentType == null) {
@ -209,6 +213,7 @@ public class MimeMessage extends Message {
* Returns a list of the given recipient type from this message. If no addresses are
* found the method returns an empty array.
*/
@Override
public Address[] getRecipients(RecipientType type) throws MessagingException {
if (type == RecipientType.TO) {
if (mTo == null) {
@ -230,6 +235,7 @@ public class MimeMessage extends Message {
}
}
@Override
public void setRecipients(RecipientType type, Address[] addresses) throws MessagingException {
final int TO_LENGTH = 4; // "To: "
final int CC_LENGTH = 4; // "Cc: "
@ -266,15 +272,18 @@ public class MimeMessage extends Message {
/**
* Returns the unfolded, decoded value of the Subject header.
*/
@Override
public String getSubject() throws MessagingException {
return MimeUtility.unfoldAndDecode(getFirstHeader("Subject"));
}
@Override
public void setSubject(String subject) throws MessagingException {
final int HEADER_NAME_LENGTH = 9; // "Subject: "
setHeader("Subject", MimeUtility.foldAndEncode2(subject, HEADER_NAME_LENGTH));
}
@Override
public Address[] getFrom() throws MessagingException {
if (mFrom == null) {
String list = MimeUtility.unfold(getFirstHeader("From"));
@ -286,6 +295,7 @@ public class MimeMessage extends Message {
return mFrom;
}
@Override
public void setFrom(Address from) throws MessagingException {
final int FROM_LENGTH = 6; // "From: "
if (from != null) {
@ -298,6 +308,7 @@ public class MimeMessage extends Message {
}
}
@Override
public Address[] getReplyTo() throws MessagingException {
if (mReplyTo == null) {
mReplyTo = Address.parse(MimeUtility.unfold(getFirstHeader("Reply-to")));
@ -305,6 +316,7 @@ public class MimeMessage extends Message {
return mReplyTo;
}
@Override
public void setReplyTo(Address[] replyTo) throws MessagingException {
final int REPLY_TO_LENGTH = 10; // "Reply-to: "
if (replyTo == null || replyTo.length == 0) {
@ -342,14 +354,17 @@ public class MimeMessage extends Message {
return messageId;
}
@Override
public void saveChanges() throws MessagingException {
throw new MessagingException("saveChanges not yet implemented");
}
@Override
public Body getBody() throws MessagingException {
return mBody;
}
@Override
public void setBody(Body body) throws MessagingException {
this.mBody = body;
if (body instanceof com.android.email.mail.Multipart) {
@ -369,18 +384,22 @@ public class MimeMessage extends Message {
return getMimeHeaders().getFirstHeader(name);
}
@Override
public void addHeader(String name, String value) throws MessagingException {
getMimeHeaders().addHeader(name, value);
}
@Override
public void setHeader(String name, String value) throws MessagingException {
getMimeHeaders().setHeader(name, value);
}
@Override
public String[] getHeader(String name) throws MessagingException {
return getMimeHeaders().getHeader(name);
}
@Override
public void removeHeader(String name) throws MessagingException {
getMimeHeaders().removeHeader(name);
if ("Message-ID".equalsIgnoreCase(name)) {

View File

@ -72,6 +72,7 @@ public class MimeMultipart extends Multipart {
this.mPreamble = preamble;
}
@Override
public String getContentType() throws MessagingException {
return mContentType;
}

View File

@ -480,6 +480,7 @@ public class ImapStore extends Store {
this.mName = name;
}
@Override
public void open(OpenMode mode, PersistentDataCallbacks callbacks)
throws MessagingException {
if (isOpen() && mMode == mode) {
@ -542,6 +543,7 @@ public class ImapStore extends Store {
}
}
@Override
public boolean isOpen() {
return mConnection != null;
}
@ -551,6 +553,7 @@ public class ImapStore extends Store {
return mMode;
}
@Override
public void close(boolean expunge) {
if (!isOpen()) {
return;
@ -563,10 +566,12 @@ public class ImapStore extends Store {
}
}
@Override
public String getName() {
return mName;
}
@Override
public boolean exists() throws MessagingException {
if (mExists) {
return true;
@ -605,10 +610,12 @@ public class ImapStore extends Store {
}
// IMAP supports folder creation
@Override
public boolean canCreate(FolderType type) {
return true;
}
@Override
public boolean create(FolderType type) throws MessagingException {
/*
* This method needs to operate in the unselected mode as well as the selected mode
@ -756,10 +763,12 @@ public class ImapStore extends Store {
return messages.toArray(new Message[] {});
}
@Override
public Message[] getMessages(MessageRetrievalListener listener) throws MessagingException {
return getMessages(null, listener);
}
@Override
public Message[] getMessages(String[] uids, MessageRetrievalListener listener)
throws MessagingException {
checkOpen();
@ -1160,6 +1169,7 @@ public class ImapStore extends Store {
* the new UID of the given message on the IMAP server and sets the Message's UID to the
* new server UID.
*/
@Override
public void appendMessages(Message[] messages) throws MessagingException {
checkOpen();
try {
@ -1245,6 +1255,7 @@ public class ImapStore extends Store {
}
}
@Override
public Message[] expunge() throws MessagingException {
checkOpen();
try {

View File

@ -1639,6 +1639,7 @@ public class LocalStore extends Store implements PersistentDataCallbacks {
return mAttachmentCount;
}
@Override
public void parse(InputStream in) throws IOException, MessagingException {
super.parse(in);
}
@ -1793,6 +1794,7 @@ public class LocalStore extends Store implements PersistentDataCallbacks {
mAttachmentId = attachmentId;
}
@Override
public String toString() {
return "" + mAttachmentId;
}

View File

@ -325,6 +325,7 @@ public class Pop3Store extends Store {
}
// POP3 does not folder creation
@Override
public boolean canCreate(FolderType type) {
return false;
}
@ -611,6 +612,7 @@ public class Pop3Store extends Store {
* @param fp
* @throws MessagingException
*/
@Override
public void fetch(Message[] messages, FetchProfile fp, MessageRetrievalListener listener)
throws MessagingException {
if (messages == null || messages.length == 0) {
@ -805,16 +807,20 @@ public class Pop3Store extends Store {
return PERMANENT_FLAGS;
}
@Override
public void appendMessages(Message[] messages) throws MessagingException {
}
@Override
public void delete(boolean recurse) throws MessagingException {
}
@Override
public Message[] expunge() throws MessagingException {
return null;
}
@Override
public void setFlags(Message[] messages, Flag[] flags, boolean value)
throws MessagingException {
if (!value || !Utility.arrayContains(flags, Flag.DELETED)) {
@ -953,6 +959,7 @@ public class Pop3Store extends Store {
mSize = size;
}
@Override
protected void parse(InputStream in) throws IOException, MessagingException {
super.parse(in);
}
@ -980,6 +987,7 @@ public class Pop3Store extends Store {
/** the server is capable of accepting multiple commands at a time (unused) */
public boolean pipelining;
@Override
public String toString() {
return String.format("STLS %b, TOP %b, USER %b, UIDL %b, PIPELINING %b",
stls,

View File

@ -61,6 +61,7 @@ public class MessagingControllerUnitTests extends AndroidTestCase {
mName = name;
}
@Override
public String getName() {
return mName;
}