This is an automated email from the ASF dual-hosted git repository. btellier pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/james-project.git
commit 7463a26da791c54e3fae662cfa73d39dcd434a3d Author: Benoit Tellier <btell...@linagora.com> AuthorDate: Thu Nov 14 11:24:51 2019 +0700 [Refactoring] MessageResultImpl: getPartContent computeIfAbsent --- .../java/org/apache/james/mailbox/store/MessageResultImpl.java | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/MessageResultImpl.java b/mailbox/store/src/main/java/org/apache/james/mailbox/store/MessageResultImpl.java index d67d32e..4fcc707 100644 --- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/MessageResultImpl.java +++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/MessageResultImpl.java @@ -40,7 +40,6 @@ import org.apache.james.mailbox.model.MessageMetaData; import org.apache.james.mailbox.model.MessageResult; import org.apache.james.mailbox.model.MimeDescriptor; import org.apache.james.mailbox.store.mail.model.MailboxMessage; -import org.apache.james.mailbox.store.mail.model.Message; import org.apache.james.mailbox.store.streaming.InputStreamContent; import org.apache.james.mailbox.store.streaming.InputStreamContent.Type; import org.apache.james.mime4j.MimeException; @@ -211,12 +210,7 @@ public class MessageResultImpl implements MessageResult { } private PartContent getPartContent(MimePath path) { - PartContent result = partsByPath.get(path); - if (result == null) { - result = new PartContent(); - partsByPath.put(path, result); - } - return result; + return partsByPath.computeIfAbsent(path, any -> new PartContent()); } private static final class PartContent { --------------------------------------------------------------------- To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org