Skip to content

Commit

Permalink
Remove unused method Message.clone()
Browse files Browse the repository at this point in the history
  • Loading branch information
cketti committed Sep 2, 2018
1 parent 83b6ab0 commit cda778e
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 79 deletions.
20 changes: 0 additions & 20 deletions app/core/src/main/java/com/fsck/k9/mailstore/LocalMessage.java
Original file line number Diff line number Diff line change
Expand Up @@ -404,26 +404,6 @@ public void destroy() throws MessagingException {
getFolder().destroyMessage(this);
}

@Override
public LocalMessage clone() {
LocalMessage message = new LocalMessage(localStore);
super.copy(message);

message.messageReference = messageReference;
message.databaseId = databaseId;
message.attachmentCount = attachmentCount;
message.subject = subject;
message.preview = preview;
message.threadId = threadId;
message.rootId = rootId;
message.messagePartId = messagePartId;
message.mimeType = mimeType;
message.previewType = previewType;
message.headerNeedsUpdating = headerNeedsUpdating;

return message;
}

public long getThreadId() {
return threadId;
}
Expand Down
23 changes: 0 additions & 23 deletions mail/common/src/main/java/com/fsck/k9/mail/Message.java
Original file line number Diff line number Diff line change
Expand Up @@ -208,27 +208,4 @@ public long calculateSize() {
}
return 0;
}

/**
* Copy the contents of this object into another {@code Message} object.
*
* @param destination The {@code Message} object to receive the contents of this instance.
*/
protected void copy(Message destination) {
destination.mUid = mUid;
destination.mInternalDate = mInternalDate;
destination.mFolder = mFolder;

// mFlags contents can change during the object lifetime, so copy the Set
destination.mFlags = EnumSet.copyOf(mFlags);
}

/**
* Creates a new {@code Message} object with the same content as this object.
*
* FIXME: Remove this method because it is no longer used.
*/
@Override
public abstract Message clone();

}
Original file line number Diff line number Diff line change
Expand Up @@ -661,42 +661,6 @@ public void field(Field parsedField) throws MimeException {
}
}

/**
* Copy the contents of this object into another {@code MimeMessage} object.
*
* @param destination The {@code MimeMessage} object to receive the contents of this instance.
*/
protected void copy(MimeMessage destination) {
super.copy(destination);

destination.mHeader = mHeader.clone();

destination.mBody = mBody;
destination.mMessageId = mMessageId;
destination.mSentDate = mSentDate;
destination.mDateFormat = mDateFormat;
destination.mSize = mSize;

// These arrays are not supposed to be modified, so it's okay to reuse the references
destination.mFrom = mFrom;
destination.mTo = mTo;
destination.mCc = mCc;
destination.mBcc = mBcc;
destination.mReplyTo = mReplyTo;
destination.mReferences = mReferences;
destination.mInReplyTo = mInReplyTo;
destination.xOriginalTo = xOriginalTo;
destination.deliveredTo = deliveredTo;
destination.xEnvelopeTo = xEnvelopeTo;
}

@Override
public MimeMessage clone() {
MimeMessage message = new MimeMessage();
copy(message);
return message;
}

@Override
public boolean hasAttachments() {
return false;
Expand Down

0 comments on commit cda778e

Please sign in to comment.