diff options
Diffstat (limited to 'sca-java-2.x/trunk')
-rw-r--r-- | sca-java-2.x/trunk/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/jackson/Object2JSON.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sca-java-2.x/trunk/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/jackson/Object2JSON.java b/sca-java-2.x/trunk/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/jackson/Object2JSON.java index 0948341b76..ffd73ffe82 100644 --- a/sca-java-2.x/trunk/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/jackson/Object2JSON.java +++ b/sca-java-2.x/trunk/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/jackson/Object2JSON.java @@ -54,7 +54,7 @@ public class Object2JSON implements PullTransformer<Object, Object> { } try { String value = mapper.writeValueAsString(source); - if (targetType == String.class || targetType == Object.class) { + if (targetType == String.class || targetType == Object.class || targetType.isPrimitive()) { return value; } else if (JsonNode.class.isAssignableFrom(targetType)) { return JacksonHelper.createJsonParser(value).readValueAsTree(); |