cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1520597 - in /cxf/trunk/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client: WebClient.java spec/ClientImpl.java
Date Fri, 06 Sep 2013 15:23:40 GMT
Author: sergeyb
Date: Fri Sep  6 15:23:40 2013
New Revision: 1520597

URL: http://svn.apache.org/r1520597
Log:
[CXF-5135] Adding a missing NPE guard to AsyncInvokerImpl

Modified:
    cxf/trunk/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/WebClient.java
    cxf/trunk/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spec/ClientImpl.java

Modified: cxf/trunk/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/WebClient.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/WebClient.java?rev=1520597&r1=1520596&r2=1520597&view=diff
==============================================================================
--- cxf/trunk/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/WebClient.java (original)
+++ cxf/trunk/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/WebClient.java Fri Sep
 6 15:23:40 2013
@@ -1443,8 +1443,8 @@ public class WebClient extends AbstractC
         public <T> Future<T> method(String name, Entity<?> entity, InvocationCallback<T>
callback) {
             WebClient.this.setEntityHeaders(entity);
             return doInvokeAsyncCallback(name, 
-                                         entity.getEntity(), 
-                                         entity.getEntity().getClass(), 
+                                         entity == null ? null : entity.getEntity(), 
+                                         entity == null ? null : entity.getEntity().getClass(),
                                          null, 
                                          callback);
         }

Modified: cxf/trunk/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spec/ClientImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spec/ClientImpl.java?rev=1520597&r1=1520596&r2=1520597&view=diff
==============================================================================
--- cxf/trunk/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spec/ClientImpl.java
(original)
+++ cxf/trunk/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spec/ClientImpl.java
Fri Sep  6 15:23:40 2013
@@ -33,6 +33,7 @@ import javax.ws.rs.client.Invocation.Bui
 import javax.ws.rs.client.WebTarget;
 import javax.ws.rs.core.Configurable;
 import javax.ws.rs.core.Configuration;
+import javax.ws.rs.core.Feature;
 import javax.ws.rs.core.Link;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.UriBuilder;
@@ -71,7 +72,12 @@ public class ClientImpl implements Clien
     @Override
     public Builder invocation(Link link) {
         checkClosed();
-        return target(link.getUriBuilder()).request();
+        Builder builder = target(link.getUriBuilder()).request();
+        String type = link.getType();
+        if (type != null) {
+            builder.accept(type);
+        }
+        return builder;
     }
 
     @Override
@@ -205,12 +211,14 @@ public class ClientImpl implements Clien
             List<Object> providers = new LinkedList<Object>();
             Configuration cfg = configImpl.getConfiguration();
             for (Object p : cfg.getInstances()) {
-                Map<Class<?>, Integer> contracts = cfg.getContracts(p.getClass());
-                if (contracts == null || contracts.isEmpty()) {
-                    providers.add(p);
-                } else {
-                    providers.add(
-                        new FilterProviderInfo<Object>(p, pf.getBus(), contracts));
+                if (!(p instanceof Feature)) {
+                    Map<Class<?>, Integer> contracts = cfg.getContracts(p.getClass());
+                    if (contracts == null || contracts.isEmpty()) {
+                        providers.add(p);
+                    } else {
+                        providers.add(
+                            new FilterProviderInfo<Object>(p, pf.getBus(), contracts));
+                    }
                 }
             }
             



Mime
View raw message