JAMES-1746 Memory implementation of Attachment mapper should comply with the 
contract


Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/e44fba57
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/e44fba57
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/e44fba57

Branch: refs/heads/JAMES-1746
Commit: e44fba5781e10835f40b523d8e802519f3e1f487
Parents: b555ae8
Author: Benoit Tellier <btell...@linagora.com>
Authored: Mon Jun 6 17:34:08 2016 +0700
Committer: Benoit Tellier <btell...@linagora.com>
Committed: Wed Jun 8 17:09:04 2016 +0700

----------------------------------------------------------------------
 .../james/mailbox/inmemory/mail/InMemoryAttachmentMapper.java     | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/e44fba57/mailbox/memory/src/main/java/org/apache/james/mailbox/inmemory/mail/InMemoryAttachmentMapper.java
----------------------------------------------------------------------
diff --git 
a/mailbox/memory/src/main/java/org/apache/james/mailbox/inmemory/mail/InMemoryAttachmentMapper.java
 
b/mailbox/memory/src/main/java/org/apache/james/mailbox/inmemory/mail/InMemoryAttachmentMapper.java
index 126fc61..a790456 100644
--- 
a/mailbox/memory/src/main/java/org/apache/james/mailbox/inmemory/mail/InMemoryAttachmentMapper.java
+++ 
b/mailbox/memory/src/main/java/org/apache/james/mailbox/inmemory/mail/InMemoryAttachmentMapper.java
@@ -28,6 +28,8 @@ import org.apache.james.mailbox.store.mail.AttachmentMapper;
 import org.apache.james.mailbox.store.mail.model.Attachment;
 import org.apache.james.mailbox.store.mail.model.AttachmentId;
 
+import com.google.common.base.Preconditions;
+
 public class InMemoryAttachmentMapper implements AttachmentMapper {
     
     private static final int INITIAL_SIZE = 128;
@@ -39,6 +41,7 @@ public class InMemoryAttachmentMapper implements 
AttachmentMapper {
 
     @Override
     public Attachment getAttachment(AttachmentId attachmentId) throws 
AttachmentNotFoundException {
+        Preconditions.checkArgument(attachmentId != null);
         if (!attachmentsById.containsKey(attachmentId)) {
             throw new AttachmentNotFoundException(attachmentId.getId());
         }


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org

Reply via email to