Return-Path: X-Original-To: apmail-cxf-issues-archive@www.apache.org Delivered-To: apmail-cxf-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 53B2A17607 for ; Tue, 7 Oct 2014 09:29:34 +0000 (UTC) Received: (qmail 49146 invoked by uid 500); 7 Oct 2014 09:29:34 -0000 Delivered-To: apmail-cxf-issues-archive@cxf.apache.org Received: (qmail 49113 invoked by uid 500); 7 Oct 2014 09:29:34 -0000 Mailing-List: contact issues-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 issues@cxf.apache.org Received: (qmail 49100 invoked by uid 99); 7 Oct 2014 09:29:34 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Oct 2014 09:29:34 +0000 Date: Tue, 7 Oct 2014 09:29:34 +0000 (UTC) From: "Sergey Beryozkin (JIRA)" To: issues@cxf.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CXF-5688) Problem Parsing FIQL Involving Enums MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CXF-5688?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14161681#comment-14161681 ] Sergey Beryozkin commented on CXF-5688: --------------------------------------- Actually, the following code {code:java} if (m != null && !MessageUtils.getContextualBoolean(m, ENUM_CONVERSION_CASE_SENSITIVE, false)) { obj = invokeValueOf(value.toUpperCase(), cls); } {code} means "Use the upper-case conversion if ENUM_CONVERSION_CASE_SENSITIVE was not set or explicitly set to false", i.e, the upper-case conversion is dome by default. So I won't be applying the change which would mean "Use the upper-case conversion if ENUM_CONVERSION_CASE_SENSITIVE was not set or set to true" which does not really makes sense. In fact I think it is a bit too over-elaborate. I can keep the current code as is but would rather prefer to drop the ENUM_CONVERSION_CASE_SENSITIVE check completely and try the upper-conversion case first and if that fails then retry with the original value - should be cheap and the code will become simpler. > Problem Parsing FIQL Involving Enums > ------------------------------------ > > Key: CXF-5688 > URL: https://issues.apache.org/jira/browse/CXF-5688 > Project: CXF > Issue Type: Bug > Components: JAX-RS > Reporter: Azitabh > Assignee: Sergey Beryozkin > Priority: Minor > Fix For: 3.0.0, 2.7.12 > > > FIQL parser assumes that enums would be defined in all caps. > In case Enums are not defined in all caps, InjectionUtils.convertStringToPrimitive(String value, Class cls) raises PropertyNotFoundException because it's converting the user provided enum value to caps and calling ENUM.valueOf(UPPERCASE_STR). > ethod m = cls.getMethod("valueOf", new Class[]{String.class}); > return m.invoke(null, value.toUpperCase()); > Since JAVA doesn't enforce enums to be all caps, I don't see any reason why FIQLParser should assume this. > https://github.com/apache/cxf/blob/master/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java -- This message was sent by Atlassian JIRA (v6.3.4#6332)