cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject git commit: [CXF-5838] Setting a correct default char value
Date Wed, 09 Jul 2014 11:39:51 GMT
Repository: cxf
Updated Branches:
  refs/heads/2.7.x-fixes 5f76a5316 -> 18f7085cb


[CXF-5838] Setting a correct default char value


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/18f7085c
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/18f7085c
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/18f7085c

Branch: refs/heads/2.7.x-fixes
Commit: 18f7085cbbb06167543aec42a82036e74cf0541d
Parents: 5f76a53
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Wed Jul 9 12:36:28 2014 +0100
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Wed Jul 9 12:39:15 2014 +0100

----------------------------------------------------------------------
 .../java/org/apache/cxf/jaxrs/utils/InjectionUtils.java   |  3 ++-
 .../src/test/java/org/apache/cxf/jaxrs/Customer.java      |  3 ++-
 .../java/org/apache/cxf/jaxrs/utils/JAXRSUtilsTest.java   | 10 ++++++----
 3 files changed, 10 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/18f7085c/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java
b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java
index cc11ddc..fdf4dd6 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java
@@ -907,7 +907,8 @@ public final class InjectionUtils {
             } else {
                 if (paramType.isPrimitive()) {
                     paramValues = Collections.singletonList(
-                        boolean.class == paramType ? "false" : "0");
+                        boolean.class == paramType ? "false" 
+                            : char.class == paramType ? Character.toString('\u0000') : "0");
                 } else if (InjectionUtils.isSupportedCollectionOrArray(paramType)) {
                     paramValues = Collections.emptyList();
                 } else {

http://git-wip-us.apache.org/repos/asf/cxf/blob/18f7085c/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/Customer.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/Customer.java b/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/Customer.java
index 2155e23..c30513f 100644
--- a/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/Customer.java
+++ b/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/Customer.java
@@ -393,7 +393,8 @@ public class Customer extends AbstractCustomer implements CustomerInfo
{
                                   @QueryParam("query2") String queryString2,
                                   @QueryParam("query3") Long queryString3,
                                   @QueryParam("query4") boolean queryBoolean4,
-                                  @QueryParam("query5") String queryString4) {
+                                  @QueryParam("query5") char queryChar5,
+                                  @QueryParam("query6") String queryString6) {
         // complete
     }
     

http://git-wip-us.apache.org/repos/asf/cxf/blob/18f7085c/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/JAXRSUtilsTest.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/JAXRSUtilsTest.java
b/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/JAXRSUtilsTest.java
index c4c58e9..b707952 100644
--- a/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/JAXRSUtilsTest.java
+++ b/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/JAXRSUtilsTest.java
@@ -1431,12 +1431,12 @@ public class JAXRSUtilsTest extends Assert {
     @Test
     public void testMultipleQueryParameters() throws Exception {
         Class<?>[] argType = {String.class, String.class, Long.class, 
-                              Boolean.TYPE, String.class};
+                              Boolean.TYPE, char.class, String.class};
         Method m = Customer.class.getMethod("testMultipleQuery", argType);
         MessageImpl messageImpl = new MessageImpl();
         
         messageImpl.put(Message.QUERY_STRING, 
-                        "query=first&query2=second&query3=3&query4=true&query5");
+                        "query=first&query2=second&query3=3&query4=true&query6");
         List<Object> params = JAXRSUtils.processParameters(new OperationResourceInfo(m,

                                                                new ClassResourceInfo(Customer.class)),

                                                            null, messageImpl);
@@ -1448,8 +1448,10 @@ public class JAXRSUtilsTest extends Assert {
                      new Long(3), params.get(2));
         assertEquals("Fourth Query Parameter of multiple was not matched correctly", 
                      Boolean.TRUE, params.get(3));
-        assertEquals("Fourth Query Parameter of multiple was not matched correctly", 
-                     "", params.get(4));
+        assertEquals("Fifth Query Parameter of multiple was not matched correctly", 
+                     '\u0000', params.get(4));
+        assertEquals("Six Query Parameter of multiple was not matched correctly", 
+                     "", params.get(5));
     }
     
     @SuppressWarnings("unchecked")


Mime
View raw message