[jira] [Commented] (CXF-5688) Problem Parsing FIQL Involving Enums

2016-02-19 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CXF-5688?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15154605#comment-15154605
 ] 

ASF GitHub Bot commented on CXF-5688:
-

GitHub user azitabh opened a pull request:

https://github.com/apache/cxf/pull/111

enhancing readability #CXF-5688



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/azitabh/cxf master

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/cxf/pull/111.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #111


commit c27f5fb93f9244882c590f6ffca97ac5c05a7e68
Author: Azitabh Ajit 
Date:   2014-10-07T06:31:22Z

enhancing readability #CXF-5688




> 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)


[jira] [Commented] (CXF-5688) Problem Parsing FIQL Involving Enums

2016-02-22 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CXF-5688?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15156758#comment-15156758
 ] 

ASF GitHub Bot commented on CXF-5688:
-

Github user sberyozkin commented on the pull request:

https://github.com/apache/cxf/pull/111#issuecomment-187119639
  
Thanks for the patch, however I believe I clarified why the code is written 
the way it is now in 
https://issues.apache.org/jira/secure/EditComment!default.jspa?id=12708243&commentId=14163245


> 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)


[jira] [Commented] (CXF-5688) Problem Parsing FIQL Involving Enums

2016-02-23 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CXF-5688?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15159302#comment-15159302
 ] 

ASF GitHub Bot commented on CXF-5688:
-

Github user asfgit closed the pull request at:

https://github.com/apache/cxf/pull/111


> 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)


[jira] [Commented] (CXF-5688) Problem Parsing FIQL Involving Enums

2014-04-15 Thread Sergey Beryozkin (JIRA)

[ 
https://issues.apache.org/jira/browse/CXF-5688?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13969505#comment-13969505
 ] 

Sergey Beryozkin commented on CXF-5688:
---

Well, the case where we have enum with say "GOOD" and "PERFECT" values and a 
query like "status=good" is more realistic to deal with; having a "Good" enum 
value and thus expecting the query contain a strictly case sensitive value such 
as "status=Good" is a bit more brittle in case of enums unless the client side 
is controlled. However I can imagine where the existing enums which can not be 
modified may need to be supported, as such a contextual property can be 
introduced to support this edge case. The property name is 
"enum.conversion.case.sensitive"

> Problem Parsing FIQL Involving Enums
> 
>
> Key: CXF-5688
> URL: https://issues.apache.org/jira/browse/CXF-5688
> Project: CXF
>  Issue Type: Bug
>Reporter: Azitabh
>Priority: Critical
>
> 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.2#6252)


[jira] [Commented] (CXF-5688) Problem Parsing FIQL Involving Enums

2014-10-02 Thread Tam Freestone-Bayes (JIRA)

[ 
https://issues.apache.org/jira/browse/CXF-5688?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14156372#comment-14156372
 ] 

Tam Freestone-Bayes commented on CXF-5688:
--

Hello Sergey,

While the addition of a property to override this behaviour is appreciated, the 
change to apply toUpperCase() to Enum comparison values is a breaking change 
from 2.6 to 2.7+. 

If only using CXF for its FiqlParser, then convertStringToPrimitive() breaks 
things when passed Enums that are not upper case (say, for instance, because 
values in legacy databases are lower or mixed case). In this situation, where 
only the FIQL Parser features of CXF are in use, there is no access to 
configuration properties via MessageUtils (there is no "current" message or 
relevant PhaseInterceptorChain). The only way to access a configuration 
property via MessageUtils requires additional dependencies on other parts of 
CXF that are not directly relevant to FIQL.

The base assumption that all Enum values would be uppercase in the first place 
seems incorrect. A developer can easily handle the "brittle" situation where, 
as you suggest, client-provided input may be in the incorrect case, by ensuring 
that any case validation is pre-applied to the fiqlExpression String passed to 
FiqlParser's parse() method.

If this auto-uppercase behaviour is to be incorporated, then it would make 
sense for it to default to "off" rather than "on". It may also be helpful to 
move its configuration to somewhere that is not tied to CXF's messaging 
components.

Kind regards,
tam

> 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)


[jira] [Commented] (CXF-5688) Problem Parsing FIQL Involving Enums

2014-10-06 Thread Sergey Beryozkin (JIRA)

[ 
https://issues.apache.org/jira/browse/CXF-5688?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14160186#comment-14160186
 ] 

Sergey Beryozkin commented on CXF-5688:
---

Hi Tam, 
I've done a minor adjustment to the conversion code which should work for all 
the cases.
Have a look please and let me know if it works for you
Cheers, Sergey

> 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)


[jira] [Commented] (CXF-5688) Problem Parsing FIQL Involving Enums

2014-10-06 Thread Tam Freestone-Bayes (JIRA)

[ 
https://issues.apache.org/jira/browse/CXF-5688?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14160354#comment-14160354
 ] 

Tam Freestone-Bayes commented on CXF-5688:
--

Thanks Sergey - looks good. For clarity, it might be worth changing

!MessageUtils.getContextualBoolean(m, ENUM_CONVERSION_CASE_SENSITIVE, false)

on line 1271 to:

MessageUtils.getContextualBoolean(m, ENUM_CONVERSION_CASE_SENSITIVE, true)

cheers,
tam

> 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)


[jira] [Commented] (CXF-5688) Problem Parsing FIQL Involving Enums

2014-10-06 Thread Sergey Beryozkin (JIRA)

[ 
https://issues.apache.org/jira/browse/CXF-5688?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14160445#comment-14160445
 ] 

Sergey Beryozkin commented on CXF-5688:
---

Sure, will do this simplification as part of the next search related bug 
fix/enhancement, thanks

> 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)


[jira] [Commented] (CXF-5688) Problem Parsing FIQL Involving Enums

2014-10-06 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CXF-5688?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14161542#comment-14161542
 ] 

ASF GitHub Bot commented on CXF-5688:
-

GitHub user azitabh opened a pull request:

https://github.com/apache/cxf/pull/24

enhancing readability #CXF-5688



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/azitabh/cxf master

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/cxf/pull/24.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #24


commit c27f5fb93f9244882c590f6ffca97ac5c05a7e68
Author: Azitabh Ajit 
Date:   2014-10-07T06:31:22Z

enhancing readability #CXF-5688




> 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)


[jira] [Commented] (CXF-5688) Problem Parsing FIQL Involving Enums

2014-10-06 Thread Azitabh (JIRA)

[ 
https://issues.apache.org/jira/browse/CXF-5688?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14161545#comment-14161545
 ] 

Azitabh commented on CXF-5688:
--

[~sergey_beryozkin], [~tam]: I have made changes suggested by Tam and have sent 
a pull request. Btw, why is the issue closed if we are still committing changes?

> 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)


[jira] [Commented] (CXF-5688) Problem Parsing FIQL Involving Enums

2014-10-07 Thread Sergey Beryozkin (JIRA)

[ 
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)


[jira] [Commented] (CXF-5688) Problem Parsing FIQL Involving Enums

2014-10-07 Thread Azitabh (JIRA)

[ 
https://issues.apache.org/jira/browse/CXF-5688?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14161782#comment-14161782
 ] 

Azitabh commented on CXF-5688:
--

[~sergey_beryozkin]: I agree with you on the first point that 
ENUM_CONVERSION_CASE_SENSITIVE should not be needed to be set explicitly to 
true in order to ensure case conversion. This in fact would break backward 
compatibility.

However, I don't think we should do a try-catch thing here. JAVA gives freedom 
of defining "Test" and "TEST" as separate values for the same ENUM. Though 
doing so doesn't make much sense, we shouldn't take that freedom away.

Leaving the code as it is seems to be the best option.

> 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)


[jira] [Commented] (CXF-5688) Problem Parsing FIQL Involving Enums

2014-10-07 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CXF-5688?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14161958#comment-14161958
 ] 

ASF GitHub Bot commented on CXF-5688:
-

Github user asfgit closed the pull request at:

https://github.com/apache/cxf/pull/24


> 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)


[jira] [Commented] (CXF-5688) Problem Parsing FIQL Involving Enums

2014-10-08 Thread Tam Freestone-Bayes (JIRA)

[ 
https://issues.apache.org/jira/browse/CXF-5688?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14163230#comment-14163230
 ] 

Tam Freestone-Bayes commented on CXF-5688:
--

As [~azitabh] points out, an Enum might exist with values of both Test and 
TEST. It would therefore make sense to check for the "original" value first, 
and then only if that fails, check for the uppercased value...

> 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)


[jira] [Commented] (CXF-5688) Problem Parsing FIQL Involving Enums

2014-10-08 Thread Sergey Beryozkin (JIRA)

[ 
https://issues.apache.org/jira/browse/CXF-5688?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14163245#comment-14163245
 ] 

Sergey Beryozkin commented on CXF-5688:
---

Tam, 
I've already referred to this issue in my 1st comment. Basically, IMHO it is 
not a good idea for a user be aware to make sure 'a=Bar' is typed for the 
case-sensitive conversion to go first successfully, the user should have no 
idea about the 'a' property type, that it might be enum, etc. The 'natural' 
query language is 'a=bar', i.e, people typically do no capitalize the first 
character of the value when doing their queries. The don't type 'a=' either but 
that is something the undelying UI script can prepend to the value entered by 
the user in this given case.
Next, IMHO 80% of enum types are actual all upper-case.

Cheers, Sergey

 

> 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)