Uploaded image for project: 'HttpComponents HttpCore'
  1. HttpComponents HttpCore
  2. HTTPCORE-681

Inconsistent behavior between WWWFormCodec and URLEncodedUtils for null input

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Trivial
    • Resolution: Not A Problem
    • 5.1
    • None
    • HttpCore
    • None

    Description

      Simple code example:

      public static void main(String[] args) {
      	System.out.println(URLEncodedUtils.parse((String) null, StandardCharsets.UTF_8)); // []
      	System.out.println(WWWFormCodec.parse((String) null, StandardCharsets.UTF_8)); // null
      }
      

       
      Basically when the input String is null, URLEncodedUtils.parse returns an empty list and WWWFormCodec.parse returns null. It's by no means a big deal, but it did catch me off guard, because I expected WWWFormCodec to be a drop-in replacement. If this was intended, then please disregard this issue.

      Attachments

        Activity

          People

            Unassigned Unassigned
            slisaasquatch Siqi Li
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: