Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-50572

JSON WS API mess method parameters if one of overloaded methods has parameter named userId of type long

Details

    Description

      JSON WS adds a userId parameter as the authenticating user. So when we have 2 methods that are overloaded with one method having userId like...

      PLEASE CHECK: LRDCOM-11968 for details. Here is the description through the example.

      Let's say we have the following API methods:

      foo(a)
      foo(a,b,c)
      foo(a,b,d)
      

      `c` is default parameter and it is always set. When calling (sudo-call):

      /foo/a,b,d
      

      it may happens that you can't call the `foo(a,b,d)` but only `foo(a,b,c)`, since c is also available.

      This fix tries to do the matching first without the default parameters. So the above call will always find the foo(a,b,d) method!

      What happens when this is called?:

      /foo/a,b
      

      Previously, this call would invoke foo(a,b,c), since c is default parameter. However, after this change the foo(a) will be called, as there is matching method without default parameters - and that is the first match.

      Attachments

        Activity

          People

            joyce.wang Joyce Wang
            igor.beslic Igor Beslic (Inactive)
            Rafaela Nascimento Rafaela Nascimento
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              8 years, 37 weeks ago

              Packages

                Version Package
                7.0.0 M2