cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1436887 - in /cxf/trunk/rt/frontend/jaxrs/src: main/java/org/apache/cxf/jaxrs/client/AbstractClient.java test/java/org/apache/cxf/jaxrs/client/WebClientTest.java
Date Tue, 22 Jan 2013 13:02:22 GMT
Author: sergeyb
Date: Tue Jan 22 13:02:22 2013
New Revision: 1436887

URL: http://svn.apache.org/viewvc?rev=1436887&view=rev
Log:
[CXF-4770] Adding NPE guard to make sure IllegalArgumentException is thrown

Modified:
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java
    cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/client/WebClientTest.java

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java?rev=1436887&r1=1436886&r2=1436887&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java
Tue Jan 22 13:02:22 2013
@@ -674,6 +674,9 @@ public abstract class AbstractClient imp
     
     
     protected String convertParamValue(Object pValue) {
+        if (pValue == null) {
+            return null;
+        }
         Class<?> pClass = pValue.getClass();
         if (pClass == String.class || pClass.isPrimitive()) {
             return pValue.toString();

Modified: cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/client/WebClientTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/client/WebClientTest.java?rev=1436887&r1=1436886&r2=1436887&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/client/WebClientTest.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/client/WebClientTest.java
Tue Jan 22 13:02:22 2013
@@ -62,6 +62,12 @@ public class WebClientTest extends Asser
         assertEquals("http://foo/bar+%20%2B;a=value+%20?b=bv%2B+%2B", u.toString());
     }
     
+    @Test(expected = IllegalArgumentException.class)
+    public void testNullPath() {
+        WebClient.create("http://foo").path(null);
+        fail("Exception expected");
+    }
+    
     @Test
     public void testExistingAsteriscs() {
         URI u = WebClient.create("http://foo/*").getCurrentURI();



Mime
View raw message