hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Loughran (JIRA)" <j...@apache.org>
Subject [jira] Created: (HTTPCORE-233) EntityUtils.toString() turns missing content into ""
Date Thu, 16 Sep 2010 10:17:32 GMT
EntityUtils.toString() turns missing content into ""

                 Key: HTTPCORE-233
                 URL: https://issues.apache.org/jira/browse/HTTPCORE-233
             Project: HttpComponents HttpCore
          Issue Type: Bug
          Components: HttpCore
    Affects Versions: 4.0.1
         Environment: Ubuntu 10.04 x64 java 6u21
            Reporter: Steve Loughran

I understand that some people may view this as expected behaviour, but I'm trying to track
down why some of my tests are failing with a message body of "" rather than some JSON, and
it looks to me a bit like {{EntityUtils}} is at fault for hiding the real problem.

Looking at line 138 of {{EntityUtils}} , the code goes
        InputStream instream = entity.getContent();
        if (instream == null) {
            return "";
that is, null content is turned into an empty string. I'd be happier if null content got returned
as null, then I'd be able to distinguish problems. As it is, I'm going to have to copy the
method and tweak it. 

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org

View raw message