hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Fetzer (JIRA)" <j...@apache.org>
Subject [jira] [Created] (HTTPCORE-301) StringEntity constructor throws null pointer exception if ContentType parameter is null.
Date Wed, 27 Jun 2012 13:50:44 GMT
Michael Fetzer created HTTPCORE-301:
---------------------------------------

             Summary: StringEntity constructor throws null pointer exception if ContentType
parameter is null.
                 Key: HTTPCORE-301
                 URL: https://issues.apache.org/jira/browse/HTTPCORE-301
             Project: HttpComponents HttpCore
          Issue Type: Bug
          Components: HttpCore
    Affects Versions: 4.2
            Reporter: Michael Fetzer


StringEntity constructor throws null pointer exception if ContentType parameter is null. According
to the documentation null is explicitly allowed. The following line:

Charset charset = contentType != null ? contentType.getCharset() : null;

should be replaced by:

if(contentType == null){
   contentType = ContentType.TEXT_PLAIN;
}
Charset charset = contentType.getCharset();
if(charset == null){
// throw an exception? assume ContentType.TEXT_PLAIN.getCharset();?
}


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


Mime
View raw message