Author: sergeyb Date: Wed Jan 25 13:17:35 2012 New Revision: 1235733 URL: http://svn.apache.org/viewvc?rev=1235733&view=rev Log: Merged revisions 1235732 via svnmerge from https://svn.apache.org/repos/asf/cxf/branches/2.4.x-fixes ................ r1235732 | sergeyb | 2012-01-25 13:15:29 +0000 (Wed, 25 Jan 2012) | 16 lines Merged revisions 1235731 via svnmerge from https://svn.apache.org/repos/asf/cxf/branches/2.5.x-fixes ................ r1235731 | sergeyb | 2012-01-25 13:13:06 +0000 (Wed, 25 Jan 2012) | 9 lines 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.3.x-fixes/ (props changed) cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java Propchange: cxf/branches/2.3.x-fixes/ ------------------------------------------------------------------------------ --- svn:mergeinfo (added) +++ svn:mergeinfo Wed Jan 25 13:17:35 2012 @@ -0,0 +1,3 @@ +/cxf/branches/2.4.x-fixes:1235732 +/cxf/branches/2.5.x-fixes:1235731 +/cxf/trunk:1235730 Propchange: cxf/branches/2.3.x-fixes/ ------------------------------------------------------------------------------ Binary property 'svnmerge-integrated' - no diff available. Modified: cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java?rev=1235733&r1=1235732&r2=1235733&view=diff ============================================================================== --- cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java (original) +++ cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java Wed Jan 25 13:17:35 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() { } @@ -380,12 +384,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; }