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

URLEncodedUtils.parse(String, CharSet) in 4.4 causes an NPE on null input and is not backward compatible

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 4.5.3, 5.0 Alpha2
    • None
    • None

    Description

      In 4.2 and 4.3, URLEncodedUtils.parse(String, CharSet) returns an empty List for a null String input.

      In 4.4, URLEncodedUtils.parse(null, Charset.forName("UTF-8")) throws an NullPointerException.

      For the sake of API backward compatibility, parse(String, CharSet) should return an empty list.

      Note that parse(String, CharSet, char...) does the null check and returns an empty list. I think parse(String, CharSet) should have the same behavior.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              steve.briskin Steve Briskin
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: