james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From btell...@apache.org
Subject [05/24] james-project git commit: JAMES-2366 Avoid creating several time the same mapping
Date Fri, 20 Apr 2018 02:12:50 GMT
JAMES-2366 Avoid creating several time the same mapping


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

Branch: refs/heads/master
Commit: b0d5e3c99de53832081140cdec225583bc52e984
Parents: eb5f4f9
Author: benwa <btellier@linagora.com>
Authored: Fri Apr 6 10:31:22 2018 +0700
Committer: benwa <btellier@linagora.com>
Committed: Thu Apr 19 11:12:07 2018 +0700

----------------------------------------------------------------------
 .../james/rrt/lib/AbstractRecipientRewriteTable.java     | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/b0d5e3c9/server/data/data-library/src/main/java/org/apache/james/rrt/lib/AbstractRecipientRewriteTable.java
----------------------------------------------------------------------
diff --git a/server/data/data-library/src/main/java/org/apache/james/rrt/lib/AbstractRecipientRewriteTable.java
b/server/data/data-library/src/main/java/org/apache/james/rrt/lib/AbstractRecipientRewriteTable.java
index 9c96e2b..9dd358d 100644
--- a/server/data/data-library/src/main/java/org/apache/james/rrt/lib/AbstractRecipientRewriteTable.java
+++ b/server/data/data-library/src/main/java/org/apache/james/rrt/lib/AbstractRecipientRewriteTable.java
@@ -193,9 +193,10 @@ public abstract class AbstractRecipientRewriteTable implements RecipientRewriteT
             throw new RecipientRewriteTableException("Invalid regex: " + regex, e);
         }
 
-        checkMapping(user, domain, MappingImpl.regex(regex));
+        MappingImpl mapping = MappingImpl.regex(regex);
+        checkMapping(user, domain, mapping);
         LOGGER.info("Add regex mapping => {} for user: {} domain: {}", regex, user, domain.name());
-        addMapping(user, domain, MappingImpl.regex(regex));
+        addMapping(user, domain, mapping);
 
     }
 
@@ -244,9 +245,11 @@ public abstract class AbstractRecipientRewriteTable implements RecipientRewriteT
 
     @Override
     public void addErrorMapping(String user, Domain domain, String error) throws RecipientRewriteTableException
{
-        checkMapping(user, domain, MappingImpl.error(error));
+        MappingImpl mapping = MappingImpl.error(error);
+
+        checkMapping(user, domain, mapping);
         LOGGER.info("Add error mapping => {} for user: {} domain: {}", error, user, domain.name());
-        addMapping(user, domain, MappingImpl.error(error));
+        addMapping(user, domain, mapping);
 
     }
 


---------------------------------------------------------------------
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