james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rouaz...@apache.org
Subject [5/7] james-project git commit: MAILBOX-279: JPAMappersTest has error on Annotation
Date Wed, 07 Dec 2016 09:12:47 GMT
MAILBOX-279: JPAMappersTest has error on Annotation


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

Branch: refs/heads/master
Commit: c8b8cf3e9d8d99da108a8af680b17d3ada2f4c8e
Parents: e873212
Author: Quynh Nguyen <qnguyen@linagora.com>
Authored: Fri Dec 2 11:25:44 2016 +0700
Committer: Quynh Nguyen <qnguyen@linagora.com>
Committed: Wed Dec 7 14:51:27 2016 +0700

----------------------------------------------------------------------
 .../org/apache/james/mailbox/jpa/mail/JPAAnnotationMapper.java     | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/c8b8cf3e/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/JPAAnnotationMapper.java
----------------------------------------------------------------------
diff --git a/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/JPAAnnotationMapper.java
b/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/JPAAnnotationMapper.java
index 5f2da21..bf802c7 100644
--- a/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/JPAAnnotationMapper.java
+++ b/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/JPAAnnotationMapper.java
@@ -27,6 +27,7 @@ import javax.persistence.NoResultException;
 import javax.persistence.PersistenceException;
 
 import com.google.common.base.Optional;
+import com.google.common.base.Preconditions;
 import com.google.common.base.Throwables;
 import org.apache.james.mailbox.jpa.JPAId;
 import org.apache.james.mailbox.jpa.JPATransactionalMapper;
@@ -169,6 +170,7 @@ public class JPAAnnotationMapper extends JPATransactionalMapper implements
Annot
 
     @Override
     public void insertAnnotation(MailboxId mailboxId, MailboxAnnotation mailboxAnnotation)
{
+        Preconditions.checkArgument(!mailboxAnnotation.isNil());
         JPAId jpaId = (JPAId) mailboxId;
         if (getAnnotationsByKeys(mailboxId, ImmutableSet.of(mailboxAnnotation.getKey())).isEmpty())
{
             getEntityManager().persist(


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


Mime
View raw message