From commits-return-17840-apmail-cxf-commits-archive=cxf.apache.org@cxf.apache.org Wed Jan 25 13:18:00 2012 Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 96B02988D for ; Wed, 25 Jan 2012 13:18:00 +0000 (UTC) Received: (qmail 85573 invoked by uid 500); 25 Jan 2012 13:18:00 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 85521 invoked by uid 500); 25 Jan 2012 13:17:59 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 85514 invoked by uid 99); 25 Jan 2012 13:17:59 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Jan 2012 13:17:59 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Jan 2012 13:17:57 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id C270B23888FE for ; Wed, 25 Jan 2012 13:17:35 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1235733 - in /cxf/branches/2.3.x-fixes: ./ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java Date: Wed, 25 Jan 2012 13:17:35 -0000 To: commits@cxf.apache.org From: sergeyb@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120125131735.C270B23888FE@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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; }