cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1520291 - in /cxf/trunk/rt: frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/ frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ rs/client/src/main/java/org/apache/cxf/jaxrs/client/spec/
Date Thu, 05 Sep 2013 12:50:47 GMT
Author: sergeyb
Date: Thu Sep  5 12:50:46 2013
New Revision: 1520291

URL: http://svn.apache.org/r1520291
Log:
[CXF-5135] Using default binding name when creating client interceptors to prevent NPE

Modified:
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/FilterProviderInfo.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ServerProviderFactory.java
    cxf/trunk/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spec/ClientImpl.java

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/FilterProviderInfo.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/FilterProviderInfo.java?rev=1520291&r1=1520290&r2=1520291&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/FilterProviderInfo.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/FilterProviderInfo.java
Thu Sep  5 12:50:46 2013
@@ -24,6 +24,7 @@ import java.util.Map;
 import java.util.Set;
 
 import org.apache.cxf.Bus;
+import org.apache.cxf.jaxrs.provider.ProviderFactory;
 
 public class FilterProviderInfo<T> extends ProviderInfo<T> {
 
@@ -32,6 +33,12 @@ public class FilterProviderInfo<T> exten
     
     public FilterProviderInfo(T provider,
                               Bus bus,
+                              Map<Class<?>, Integer> supportedContracts) {
+        this(provider, bus, ProviderFactory.DEFAULT_FILTER_NAME_BINDING, supportedContracts);
       
+    }
+    
+    public FilterProviderInfo(T provider,
+                              Bus bus,
                               String nameBinding,
                               Map<Class<?>, Integer> supportedContracts) {
         super(provider, bus);

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java?rev=1520291&r1=1520290&r2=1520291&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java
Thu Sep  5 12:50:46 2013
@@ -77,7 +77,7 @@ import org.apache.cxf.message.Message;
 import org.apache.cxf.message.MessageUtils;
 
 public abstract class ProviderFactory {
-    protected static final String DEFAULT_FILTER_NAME_BINDING = "org.apache.cxf.filter.binding";
+    public static final String DEFAULT_FILTER_NAME_BINDING = "org.apache.cxf.filter.binding";
     protected static final String SERVER_FACTORY_NAME = "org.apache.cxf.jaxrs.provider.ServerProviderFactory";
     protected static final String CLIENT_FACTORY_NAME = "org.apache.cxf.jaxrs.client.ClientProviderFactory";
     protected static final String IGNORE_TYPE_VARIABLES = "org.apache.cxf.jaxrs.providers.ignore.typevars";
@@ -362,7 +362,7 @@ public abstract class ProviderFactory {
             if (size > 0) {
                 interceptors = new ArrayList<ReaderInterceptor>(size + 1);
                 List<ProviderInfo<ReaderInterceptor>> readers =
-                    getPostMatchContainerFilters(readerInterceptors, names);
+                    getBoundFilters(readerInterceptors, names);
                 for (ProviderInfo<ReaderInterceptor> p : readers) {
                     InjectionUtils.injectContexts(p.getProvider(), p, m);
                     interceptors.add(p.getProvider());
@@ -401,7 +401,7 @@ public abstract class ProviderFactory {
             if (size > 0) {
                 interceptors = new ArrayList<WriterInterceptor>(size + 1);
                 List<ProviderInfo<WriterInterceptor>> writers =
-                    getPostMatchContainerFilters(writerInterceptors, names);
+                    getBoundFilters(writerInterceptors, names);
                 for (ProviderInfo<WriterInterceptor> p : writers) {
                     InjectionUtils.injectContexts(p.getProvider(), p, m);
                     interceptors.add(p.getProvider());
@@ -884,7 +884,7 @@ public abstract class ProviderFactory {
         }
     }
 
-    protected static <T> List<ProviderInfo<T>> getPostMatchContainerFilters(Map<NameKey,
ProviderInfo<T>> boundFilters,
+    protected static <T> List<ProviderInfo<T>> getBoundFilters(Map<NameKey,
ProviderInfo<T>> boundFilters,
                                                                           Set<String>
names) {
         if (boundFilters.isEmpty()) {
             return Collections.emptyList();

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ServerProviderFactory.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ServerProviderFactory.java?rev=1520291&r1=1520290&r2=1520291&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ServerProviderFactory.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ServerProviderFactory.java
Thu Sep  5 12:50:46 2013
@@ -138,7 +138,7 @@ public final class ServerProviderFactory
     }
     
     public List<ProviderInfo<ContainerRequestFilter>> getPostMatchContainerRequestFilters(Set<String>
names) {
-        return getPostMatchContainerFilters(postMatchContainerRequestFilters, names);
+        return getBoundFilters(postMatchContainerRequestFilters, names);
         
     }
     
@@ -165,7 +165,7 @@ public final class ServerProviderFactory
     }
     
     public List<ProviderInfo<ContainerResponseFilter>> getContainerResponseFilters(Set<String>
names) {
-        return getPostMatchContainerFilters(postMatchContainerResponseFilters, 
+        return getBoundFilters(postMatchContainerResponseFilters, 
                                             names);
     }
     

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=1520291&r1=1520290&r2=1520291&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
Thu Sep  5 12:50:46 2013
@@ -210,7 +210,7 @@ public class ClientImpl implements Clien
                     providers.add(p);
                 } else {
                     providers.add(
-                        new FilterProviderInfo<Object>(p, pf.getBus(), null, contracts));
+                        new FilterProviderInfo<Object>(p, pf.getBus(), contracts));
                 }
             }
             



Mime
View raw message