Pluto
  1. Pluto
  2. PLUTO-583

PortalURLParserImpl: unnecessary "?"

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: 2.0.0
    • Fix Version/s: 2.0.2, 2.1.0
    • Component/s: portal driver
    • Labels:
      None

      Description

      When creating an URL with "public String toString(PortalURL portalURL)" an unnecessary "?" is added if the query is empty (org.apache.pluto.driver.url.impl.PortalURLParserImpl).
      This is the part of the source code where the URL is finally composed:


      // Construct the string representing the portal URL.
      // Fix for PLUTO-247 - check if query string contains parameters
      if ( query.length() > 1 )

      { return buffer.append(query).toString(); }

      // Construct the string representing the portal URL.
      return buffer.append(query).toString();

      There was already a fix for this issue (PLUTO-247). May be this reappeared after some refactoring. The statement in the if-block and the one behind the if-block is the same.
      The unnecessary "?" caused problems when using the URL as action in a form within a HTTPUnit-Test because the testframework does not look at the final character of the URL and adds an additional "?".

        Activity

        Hide
        Ate Douma added a comment -

        Fixed, thanks for reporting.

        Show
        Ate Douma added a comment - Fixed, thanks for reporting.

          People

          • Assignee:
            Ate Douma
            Reporter:
            Jürgen Gahl
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development