rmannibucau commented on a change in pull request #39: Deserialization of 
primitives
URL: https://github.com/apache/johnzon/pull/39#discussion_r271665867
 
 

 ##########
 File path: 
johnzon-mapper/src/main/java/org/apache/johnzon/mapper/MappingParserImpl.java
 ##########
 @@ -727,9 +728,9 @@ private Object toValue(final Object baseInstance, final 
JsonValue jsonValue, fin
                            final JsonPointerTracker jsonPointer, final Type 
rootType) {
 
         if (objectConverter != null) {
-
-            if (jsonValue instanceof JsonObject) {
-                return objectConverter.fromJson((JsonObject) jsonValue, type, 
this);
+            
+            if (EnumSet.of(ValueType.OBJECT, ValueType.NUMBER, 
ValueType.STRING, ValueType.FALSE, 
ValueType.TRUE).contains(jsonValue.getValueType())) {
 
 Review comment:
   isnt it simpler reversing the test (if array => else =>)?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to