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 bt...@apache.org on 2017/01/24 05:49:10 UTC
[10/15] james-project git commit: JAMES-1785 Improve
UpdateMessagePatchValidator
JAMES-1785 Improve UpdateMessagePatchValidator
Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/d409d2b2
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/d409d2b2
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/d409d2b2
Branch: refs/heads/master
Commit: d409d2b2c7285a0737a5c63e52f0c4da747ce1ed
Parents: 17a1cb8
Author: Quynh Nguyen <qn...@linagora.com>
Authored: Thu Jan 19 10:42:29 2017 +0700
Committer: Quynh Nguyen <qn...@linagora.com>
Committed: Tue Jan 24 09:58:20 2017 +0700
----------------------------------------------------------------------
.../james/jmap/methods/UpdateMessagePatchValidator.java | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/james-project/blob/d409d2b2/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/UpdateMessagePatchValidator.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/UpdateMessagePatchValidator.java b/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/UpdateMessagePatchValidator.java
index 963c074..fc77821 100644
--- a/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/UpdateMessagePatchValidator.java
+++ b/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/UpdateMessagePatchValidator.java
@@ -50,20 +50,19 @@ public class UpdateMessagePatchValidator implements Validator<ObjectNode> {
@Override
public Set<ValidationResult> validate(ObjectNode json) {
- ImmutableSet<ValidationResult> compilation = ImmutableSet.of();
try {
parser.readValue(json.toString(), UpdateMessagePatch.class);
} catch (JsonMappingException e) {
- compilation = ImmutableSet.of(ValidationResult.builder()
+ return ImmutableSet.of(ValidationResult.builder()
.property(firstFieldFrom(e.getPath()).orElse(ValidationResult.UNDEFINED_PROPERTY))
.message(e.getMessage())
.build());
} catch (IOException e) {
- compilation = ImmutableSet.of(ValidationResult.builder()
+ return ImmutableSet.of(ValidationResult.builder()
.message(e.getMessage())
.build());
}
- return compilation;
+ return ImmutableSet.of();
}
private Optional<String> firstFieldFrom(List<JsonMappingException.Reference> references) {
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org