cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1080267 - /cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java
Date Thu, 10 Mar 2011 16:35:07 GMT
Author: sergeyb
Date: Thu Mar 10 16:35:06 2011
New Revision: 1080267

URL: http://svn.apache.org/viewvc?rev=1080267&view=rev
Log:
[CF-3390] Applying a patch on behalf of Ben Noordhuis - thanks

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

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java?rev=1080267&r1=1080266&r2=1080267&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java (original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java Thu
Mar 10 16:35:06 2011
@@ -188,6 +188,11 @@ public final class JAXRSUtils {
                                      Message message) {
         ClassResourceInfo cri = ori.getClassResourceInfo();
         InjectionUtils.injectContextMethods(requestObject, cri, message);
+        
+        if (cri.isSingleton() 
+            && (!cri.getParameterMethods().isEmpty() || !cri.getParameterFields().isEmpty()))
{
+            LOG.fine("Injecting request parameters into singleton resource is not thread-safe");
+        }
         // Param methods
         MultivaluedMap<String, String> values = 
             (MultivaluedMap<String, String>)message.get(URITemplate.TEMPLATE_PARAMETERS);
@@ -199,9 +204,7 @@ public final class JAXRSUtils {
                                                 message,
                                                 values,
                                                 ori);
-            if (o != null) { 
-                InjectionUtils.injectThroughMethod(requestObject, m, o);
-            }
+            InjectionUtils.injectThroughMethod(requestObject, m, o);
         }
         // Param fields
         for (Field f : cri.getParameterFields()) {
@@ -212,9 +215,7 @@ public final class JAXRSUtils {
                                                 message,
                                                 values,
                                                 ori);
-            if (o != null) { 
-                InjectionUtils.injectFieldValue(f, requestObject, o);
-            }
+            InjectionUtils.injectFieldValue(f, requestObject, o);
         }
         
     }



Mime
View raw message