diff options
Diffstat (limited to 'sca-java-2.x/trunk/modules')
5 files changed, 14 insertions, 0 deletions
diff --git a/sca-java-2.x/trunk/modules/binding-jsonp-runtime/src/test/java/helloworld/HelloWorldClient.java b/sca-java-2.x/trunk/modules/binding-jsonp-runtime/src/test/java/helloworld/HelloWorldClient.java index 66cf8f5b98..f4a2023b17 100644 --- a/sca-java-2.x/trunk/modules/binding-jsonp-runtime/src/test/java/helloworld/HelloWorldClient.java +++ b/sca-java-2.x/trunk/modules/binding-jsonp-runtime/src/test/java/helloworld/HelloWorldClient.java @@ -37,4 +37,8 @@ public class HelloWorldClient implements HelloWorldService { public BeanA sayHello3(BeanA bean) { return ref.sayHello3(bean); } + + public int sayHello4(boolean flag) { + return ref.sayHello4(flag); + } } diff --git a/sca-java-2.x/trunk/modules/binding-jsonp-runtime/src/test/java/helloworld/HelloWorldImpl.java b/sca-java-2.x/trunk/modules/binding-jsonp-runtime/src/test/java/helloworld/HelloWorldImpl.java index 94b7c64dba..f73b185ead 100644 --- a/sca-java-2.x/trunk/modules/binding-jsonp-runtime/src/test/java/helloworld/HelloWorldImpl.java +++ b/sca-java-2.x/trunk/modules/binding-jsonp-runtime/src/test/java/helloworld/HelloWorldImpl.java @@ -33,5 +33,9 @@ public class HelloWorldImpl implements HelloWorldService { bean.setS("XYZ"); return bean; } + + public int sayHello4(boolean flag) { + return 0; + } } diff --git a/sca-java-2.x/trunk/modules/binding-jsonp-runtime/src/test/java/helloworld/HelloWorldService.java b/sca-java-2.x/trunk/modules/binding-jsonp-runtime/src/test/java/helloworld/HelloWorldService.java index a215ecf4be..790fdd7467 100644 --- a/sca-java-2.x/trunk/modules/binding-jsonp-runtime/src/test/java/helloworld/HelloWorldService.java +++ b/sca-java-2.x/trunk/modules/binding-jsonp-runtime/src/test/java/helloworld/HelloWorldService.java @@ -28,5 +28,7 @@ public interface HelloWorldService { String sayHello2(String firstName, String lastName); BeanA sayHello3(BeanA bean); + + int sayHello4(boolean flag); } diff --git a/sca-java-2.x/trunk/modules/binding-jsonp-runtime/src/test/java/test/BindingTestCase.java b/sca-java-2.x/trunk/modules/binding-jsonp-runtime/src/test/java/test/BindingTestCase.java index 6923243d1a..27b8cec2f1 100644 --- a/sca-java-2.x/trunk/modules/binding-jsonp-runtime/src/test/java/test/BindingTestCase.java +++ b/sca-java-2.x/trunk/modules/binding-jsonp-runtime/src/test/java/test/BindingTestCase.java @@ -66,6 +66,7 @@ public class BindingTestCase { Assert.assertEquals("Hello beate", client.sayHello("beate")); Assert.assertEquals("Hello beate arnold", client.sayHello2("beate", "arnold")); + Assert.assertEquals(0, client.sayHello4(true)); } @Test 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 ffd73ffe82..f405d2b687 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 @@ -53,6 +53,9 @@ public class Object2JSON implements PullTransformer<Object, Object> { targetType = String.class; } try { + if (targetType != null && targetType.isPrimitive()) { + return source; + } String value = mapper.writeValueAsString(source); if (targetType == String.class || targetType == Object.class || targetType.isPrimitive()) { return value; |