Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-5688

Problem Parsing FIQL Involving Enums

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.0, 2.7.12
    • Component/s: JAX-RS
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      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

        Attachments

          Activity

            People

            • Assignee:
              sergey_beryozkin Sergey Beryozkin
              Reporter:
              azitabh Azitabh
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: