You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by rc...@apache.org on 2020/02/18 02:48:17 UTC
[james-project] 06/08: JAMES-3057 Rename some variables in
StoreMailboxManager
This is an automated email from the ASF dual-hosted git repository.
rcordier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git
commit 40b671e4fc21c2cb7c848833917179360f9b5589
Author: Rene Cordier <rc...@linagora.com>
AuthorDate: Tue Feb 11 11:27:40 2020 +0700
JAMES-3057 Rename some variables in StoreMailboxManager
---
.../james/mailbox/store/StoreMailboxManager.java | 26 +++++++++++-----------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreMailboxManager.java b/mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreMailboxManager.java
index 940c88d..bcad33d 100644
--- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreMailboxManager.java
+++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreMailboxManager.java
@@ -353,20 +353,20 @@ public class StoreMailboxManager implements MailboxManager {
return intermediatePaths
.stream()
- .flatMap(Throwing.<MailboxPath, Stream<MailboxId>>function(mailbox -> manageMailboxCreation(mailboxSession, isRootPath, mailbox)).sneakyThrow())
+ .flatMap(Throwing.<MailboxPath, Stream<MailboxId>>function(mailboxPath -> manageMailboxCreation(mailboxSession, isRootPath, mailboxPath)).sneakyThrow())
.collect(Guavate.toImmutableList());
}
- private Stream<MailboxId> manageMailboxCreation(MailboxSession mailboxSession, boolean isRootPath, MailboxPath mailbox) throws MailboxException {
- if (mailbox.isInbox()) {
+ private Stream<MailboxId> manageMailboxCreation(MailboxSession mailboxSession, boolean isRootPath, MailboxPath mailboxPath) throws MailboxException {
+ if (mailboxPath.isInbox()) {
if (hasInbox(mailboxSession)) {
- return duplicatedINBOXCreation(isRootPath, mailbox);
+ return duplicatedINBOXCreation(isRootPath, mailboxPath);
}
return performConcurrentMailboxCreation(mailboxSession, MailboxPath.inbox(mailboxSession)).stream();
}
- return performConcurrentMailboxCreation(mailboxSession, mailbox).stream();
+ return performConcurrentMailboxCreation(mailboxSession, mailboxPath).stream();
}
@@ -378,24 +378,24 @@ public class StoreMailboxManager implements MailboxManager {
return Stream.empty();
}
- private List<MailboxId> performConcurrentMailboxCreation(MailboxSession mailboxSession, MailboxPath mailbox) throws MailboxException {
+ private List<MailboxId> performConcurrentMailboxCreation(MailboxSession mailboxSession, MailboxPath mailboxPath) throws MailboxException {
List<MailboxId> mailboxIds = new ArrayList<>();
- locker.executeWithLock(mailbox, (LockAwareExecution<Void>) () -> {
- if (!mailboxExists(mailbox, mailboxSession)) {
- Mailbox m = doCreateMailbox(mailbox);
+ locker.executeWithLock(mailboxPath, (LockAwareExecution<Void>) () -> {
+ if (!mailboxExists(mailboxPath, mailboxSession)) {
+ Mailbox mailbox = doCreateMailbox(mailboxPath);
MailboxMapper mapper = mailboxSessionMapperFactory.getMailboxMapper(mailboxSession);
try {
- mapper.execute(Mapper.toTransaction(() -> mailboxIds.add(mapper.save(m))));
+ mapper.execute(Mapper.toTransaction(() -> mailboxIds.add(mapper.save(mailbox))));
// notify listeners
eventBus.dispatch(EventFactory.mailboxAdded()
.randomEventId()
.mailboxSession(mailboxSession)
- .mailbox(m)
+ .mailbox(mailbox)
.build(),
- new MailboxIdRegistrationKey(m.getMailboxId()))
+ new MailboxIdRegistrationKey(mailbox.getMailboxId()))
.block();
} catch (MailboxExistsException e) {
- LOGGER.info("{} mailbox was created concurrently", m.generateAssociatedPath());
+ LOGGER.info("{} mailbox was created concurrently", mailbox.generateAssociatedPath());
}
}
return null;
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org