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 970357f0fe69f6ffb85a9046cbff849ad75bd5eb Author: Benoit Tellier <[email protected]> AuthorDate: Tue Nov 26 08:02:14 2019 +0100 [Refactoring] Correct ModSeq mailbox json serializer --- .../scala/org/apache/james/event/json/EventSerializer.scala | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/mailbox/event/json/src/main/scala/org/apache/james/event/json/EventSerializer.scala b/mailbox/event/json/src/main/scala/org/apache/james/event/json/EventSerializer.scala index 4babdbb..e2001dc 100644 --- a/mailbox/event/json/src/main/scala/org/apache/james/event/json/EventSerializer.scala +++ b/mailbox/event/json/src/main/scala/org/apache/james/event/json/EventSerializer.scala @@ -279,19 +279,11 @@ class JsonSerialize(mailboxIdFactory: MailboxId.Factory, messageIdFactory: Messa case _ => JsError() } implicit val messageUidReads: Reads[MessageUid] = { - case JsNumber(value) => if (value.isValidLong) { - JsSuccess(MessageUid.of(value.toLong)) - } else { - JsError() - } + case JsNumber(value) if value.isValidLong => JsSuccess(MessageUid.of(value.toLong)) case _ => JsError() } implicit val modSeqReads: Reads[ModSeq] = { - case JsNumber(value) => if (value.isValidLong) { - JsSuccess(ModSeq.of(value.toLong)) - } else { - JsError() - } + case JsNumber(value) if value.isValidLong => JsSuccess(ModSeq.of(value.toLong)) case _ => JsError() } implicit val userFlagsReads: Reads[UserFlag] = { --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
