cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1235731 - in /cxf/branches/2.5.x-fixes: ./ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java
Date Wed, 25 Jan 2012 13:13:06 GMT
Author: sergeyb
Date: Wed Jan 25 13:13:06 2012
New Revision: 1235731

URL: http://svn.apache.org/viewvc?rev=1235731&view=rev
Log:
Merged revisions 1235730 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1235730 | sergeyb | 2012-01-25 13:09:41 +0000 (Wed, 25 Jan 2012) | 1 line
  
  [CXF-4055] Optionally checking ParameterHandlers first
........

Modified:
    cxf/branches/2.5.x-fixes/   (props changed)
    cxf/branches/2.5.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java

Propchange: cxf/branches/2.5.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Jan 25 13:13:06 2012
@@ -1 +1 @@
-/cxf/trunk:1235544
+/cxf/trunk:1235544,1235730

Propchange: cxf/branches/2.5.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.5.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java?rev=1235731&r1=1235730&r2=1235731&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java
(original)
+++ cxf/branches/2.5.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java
Wed Jan 25 13:13:06 2012
@@ -37,6 +37,7 @@ import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
+import java.util.Date;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.LinkedHashMap;
@@ -88,6 +89,7 @@ import org.apache.cxf.jaxrs.model.Parame
 import org.apache.cxf.jaxrs.model.ParameterType;
 import org.apache.cxf.jaxrs.provider.ProviderFactory;
 import org.apache.cxf.message.Message;
+import org.apache.cxf.message.MessageUtils;
 
 public final class InjectionUtils {
     
@@ -99,6 +101,8 @@ public final class InjectionUtils {
     private static final String HTTP_SERVLET_REQUEST_CLASS_NAME = "javax.servlet.http.HttpServletRequest";
     private static final String HTTP_SERVLET_RESPONSE_CLASS_NAME = "javax.servlet.http.HttpServletResponse";
         
+    private static final String PARAM_HANDLERS_FIRST = "check.parameter.handlers.first";
+    
     private InjectionUtils() {
         
     }
@@ -378,12 +382,10 @@ public final class InjectionUtils {
 
     private static Object instantiateFromParameterHandler(String value, 
                                                      Class<?> pClass,
-                                                     Message message) {
-        // TODO: Consider always checking custom parameter handlers first.
-        // Right now, Locale and Date are two special cases so it's very cheap
-        // just to check if it is Locale or not; 
-        if (Locale.class == pClass) {
-            return createFromParameterHandler(value, pClass, message);
+                                                     Message m) {
+        if (Date.class == pClass || Locale.class == pClass 
+            || m != null && MessageUtils.isTrue(m.getContextualProperty(PARAM_HANDLERS_FIRST)))
{
+            return createFromParameterHandler(value, pClass, m);
         } else {
             return null;
         }



Mime
View raw message