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

FIQL Parsers Beanspector, replaces "is", "set" and "get" in method names

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.5.2
    • Fix Version/s: 2.3, 2.4.7, 2.5.3, 2.6
    • Component/s: JAX-RS
    • Labels:
    • Environment:

      Java6

    • Estimated Complexity:
      Novice

      Description

      I try to use FIQL for search. When I init a new Parser, it caches all getters and setters of the target resource type class via Beanspector. All method names are updated to lower case and a possible leading "is", "get" or "set" should be replaced.

      -> The replacement effectes not only leading strings! "isPromissed" will be changed in "promsed"!
      (see code, Beanspector:183)
      private String setterName(Method m) {
      return m.getName().replace("is", "").replace("set", "").toLowerCase();
      }

      Please change this method in a implementation, like this:

      private String methodName(Method m) {
      String result = m.getName().toLowerCase();

      if (result.startsWith("is"))

      { result = result.substring(2, result.length()); }

      else if (result.startsWith("set") || result.startsWith("get"))

      { result = result.substring(3, result.length()); }

      return result;
      }

      Thanks,
      Stefan

        Attachments

          Activity

            People

            • Assignee:
              sergey_beryozkin Sergey Beryozkin
              Reporter:
              nast0011 Stefan Nawrath
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 24h
                24h
                Remaining:
                Remaining Estimate - 24h
                24h
                Logged:
                Time Spent - Not Specified
                Not Specified