cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1492182 - /cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/AbstractJAXRSFactoryBean.java
Date Wed, 12 Jun 2013 13:15:53 GMT
Author: sergeyb
Date: Wed Jun 12 13:15:53 2013
New Revision: 1492182

URL: http://svn.apache.org/r1492182
Log:
Making sure multiple calls to JAXRSServerFactoryBean.setProvider does not lose the providers
registered earlier

Modified:
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/AbstractJAXRSFactoryBean.java

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/AbstractJAXRSFactoryBean.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/AbstractJAXRSFactoryBean.java?rev=1492182&r1=1492181&r2=1492182&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/AbstractJAXRSFactoryBean.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/AbstractJAXRSFactoryBean.java
Wed Jun 12 13:15:53 2013
@@ -23,6 +23,7 @@ import java.util.Arrays;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.Iterator;
+import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
 import java.util.ResourceBundle;
@@ -71,7 +72,7 @@ public class AbstractJAXRSFactoryBean ex
     
     protected List<String> schemaLocations;
     protected JAXRSServiceFactoryBean serviceFactory;
-    protected List<?> entityProviders;
+    protected List<Object> entityProviders = new LinkedList<Object>();
     
     protected AbstractJAXRSFactoryBean(JAXRSServiceFactoryBean serviceFactory) {
         this.serviceFactory = serviceFactory;
@@ -278,21 +279,21 @@ public class AbstractJAXRSFactoryBean ex
     }
 
     /**
-     * Sets custom JAX-RS providers.
+     * Add custom JAX-RS providers to the list of providers
      * 
      * @param entityProviders the entityProviders
      */
     public void setProviders(List<? extends Object> providers) {
-        this.entityProviders = providers;
+        this.entityProviders.addAll(providers);
     }
     
     /**
-     * Sets a custom JAX-RS provider.
+     * Add custom JAX-RS provider to the list of providers
      * 
      * @param provider the custom provider.
      */
     public void setProvider(Object provider) {
-        setProviders(Collections.singletonList(provider));
+        entityProviders.add(provider);
     }
 
     protected void checkResources(boolean server) {



Mime
View raw message