Uploaded image for project: 'HttpComponents HttpClient'
  1. HttpComponents HttpClient
  2. HTTPCLIENT-1761

Missing null check in parse method

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 4.4.1, 4.5, 4.5.1, 4.5.2
    • 4.5.3
    • None
    • None
    • Patch

    Description

      While in org.apache.http.client.utils.URLEncodedUtils the method

      public static List<NameValuePair> parse(String s, Charset charset, char... separators)
      

      has a null check for String "s", this method has no null check:

      public static List<NameValuePair> parse(String s, Charset charset)
      

      For consistency and backward compatibility reasons I recommend adding a null check there.

      Furthermore I would delegate to the method with separators:

      public static List<NameValuePair> parse(String s, Charset charset) {
              return URLEncodedUtils.parse(s, charset, '&', ';');
      } 
      

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            tfeiner Thomas Feiner
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment