diff options
Diffstat (limited to 'sca-java-1.x/trunk/modules/databinding-json-2-x/src/main/java/org/apache/tuscany/sca/databinding/json2x/jackson')
-rw-r--r-- | sca-java-1.x/trunk/modules/databinding-json-2-x/src/main/java/org/apache/tuscany/sca/databinding/json2x/jackson/Object2JSON.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sca-java-1.x/trunk/modules/databinding-json-2-x/src/main/java/org/apache/tuscany/sca/databinding/json2x/jackson/Object2JSON.java b/sca-java-1.x/trunk/modules/databinding-json-2-x/src/main/java/org/apache/tuscany/sca/databinding/json2x/jackson/Object2JSON.java index d7d04d7848..fbc4b5009b 100644 --- a/sca-java-1.x/trunk/modules/databinding-json-2-x/src/main/java/org/apache/tuscany/sca/databinding/json2x/jackson/Object2JSON.java +++ b/sca-java-1.x/trunk/modules/databinding-json-2-x/src/main/java/org/apache/tuscany/sca/databinding/json2x/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();
|