Details

      Description

      Some methods of the API uses array based last argument like in BaseURL:

      public void setParameter (String name, String[] values);

      I suggest we could replace this by a varargs, providing the same signature and improving the usability of the API to:

      public void setParameter (String name, String... values);

        Activity

        Hide
        Neil Griffin added a comment -

        +1 great flexibility

        Show
        Neil Griffin added a comment - +1 great flexibility
        Hide
        andre.hagemeier added a comment -

        +1

        Show
        andre.hagemeier added a comment - +1
        Hide
        msnicklous added a comment -

        I can find the following methods where this would be useful:

        BaseURL.setParameter (String name, String[] values)
        PortletPreferences.setValues(String key, String[] values)
        StateAwareResponse.setRenderParameter(String key, String[] values)

        did I miss any?

        How do you actually document a vararg argument in the javadoc comments? For example, the first line of BaseURL.setParameter reads

        Sets the given String array parameter to this URL.

        Should we just leave it like that?

        "Sets the String vararg ..." sounds weird to me.

        Show
        msnicklous added a comment - I can find the following methods where this would be useful: BaseURL.setParameter (String name, String[] values) PortletPreferences.setValues(String key, String[] values) StateAwareResponse.setRenderParameter(String key, String[] values) did I miss any? How do you actually document a vararg argument in the javadoc comments? For example, the first line of BaseURL.setParameter reads Sets the given String array parameter to this URL. Should we just leave it like that? "Sets the String vararg ..." sounds weird to me.
        Hide
        msnicklous added a comment -

        Changed String[] parameter to String... parameter on the methods BaseURL.setParameter StateAwareResponse.setRenderParameter PortletPreferences.setValues.

        I decided to call them multi-valued parameters, as in:

        "Sets a multi-valued String parameter for the render request."

        Hope this terminology is found to be appropriate.

        Show
        msnicklous added a comment - Changed String[] parameter to String... parameter on the methods BaseURL.setParameter StateAwareResponse.setRenderParameter PortletPreferences.setValues . I decided to call them multi-valued parameters, as in: "Sets a multi-valued String parameter for the render request." Hope this terminology is found to be appropriate.
        Hide
        msnicklous added a comment -

        done.

        Show
        msnicklous added a comment - done.

          People

          • Assignee:
            msnicklous
            Reporter:
            julien_viet
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: