diff options
author | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2010-09-03 13:01:12 +0000 |
---|---|---|
committer | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2010-09-03 13:01:12 +0000 |
commit | 2d55d4209a73d065b7f16ef1d5ea93bb97be6393 (patch) | |
tree | 1e3565bf1c1ac6251c6a407f2f01a1591b229185 /sca-java-2.x/trunk/modules/databinding-json/src/main/java/org | |
parent | d6484fcf1ccf4fb497001f060fdaed805b9d5e73 (diff) |
Allow primitive return values to pass through the Object2JSON transformer.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@992281 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/databinding-json/src/main/java/org')
-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(); |