cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergey Beryozkin (JIRA)" <>
Subject [jira] [Commented] (CXF-5688) Problem Parsing FIQL Involving Enums
Date Wed, 08 Oct 2014 08:56:34 GMT


Sergey Beryozkin commented on CXF-5688:

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:
>             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.

This message was sent by Atlassian JIRA

View raw message