Author: sergeyb
Date: Tue Jan 22 13:14:43 2013
New Revision: 1436895
URL: http://svn.apache.org/viewvc?rev=1436895&view=rev
Log:
Merged revisions 1436887,1436893 via svnmerge from
https://svn.apache.org/repos/asf/cxf/trunk
........
r1436887 | sergeyb | 2013-01-22 13:02:22 +0000 (Tue, 22 Jan 2013) | 1 line
[CXF-4770] Adding NPE guard to make sure IllegalArgumentException is thrown
........
r1436893 | sergeyb | 2013-01-22 13:10:18 +0000 (Tue, 22 Jan 2013) | 1 line
[CXF-4770] One more test
........
Modified:
cxf/branches/2.7.x-fixes/ (props changed)
cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java
cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/client/WebClientTest.java
Propchange: cxf/branches/2.7.x-fixes/
------------------------------------------------------------------------------
Merged /cxf/trunk:r1436887-1436893
Propchange: cxf/branches/2.7.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified:
cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java
URL:
http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java?rev=1436895&r1=1436894&r2=1436895&view=diff
==============================================================================
---
cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java
(original)
+++
cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java
Tue Jan 22 13:14:43 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/branches/2.7.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/client/WebClientTest.java
URL:
http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/client/WebClientTest.java?rev=1436895&r1=1436894&r2=1436895&view=diff
==============================================================================
---
cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/client/WebClientTest.java
(original)
+++
cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/client/WebClientTest.java
Tue Jan 22 13:14:43 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();
@@ -280,6 +286,13 @@ public class WebClientTest extends Asser
assertNotNull(WebClient.getConfig(proxy2) != null);
}
+ @Test(expected = IllegalArgumentException.class)
+ public void testProxyNull() {
+ // interface
+ BookInterface proxy = JAXRSClientFactory.create("http://foo",
BookInterface.class);
+ proxy.getBook(null);
+ }
+
private static class ParamConverterProviderImpl implements
ParamConverterProvider {
@SuppressWarnings("unchecked")