commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nathan Coast <nathan.co...@levelseas.com>
Subject HttpClient bug?
Date Thu, 29 Nov 2001 16:45:10 GMT
org.apache.commons.httpclient.HttpClient

Hi, I found line 183 throws a NullPointer if setState() hasn't been called
previously


    public void startSession(String host, int port, Credentials creds,
                             boolean https) {
        log.debug("HttpClient.startSession(String,int,Credentials,boolean):
Host:" +
                  host + " Port:" + port + " Credentials:" + creds +
                  " HTTPS:" + https);
        state.setCredentials(null,creds);
        connection = new HttpConnection(host,port,https);
    }

replacing state with getState() would remove the need to call setState(new
HttpState());

    public void startSession(String host, int port, Credentials creds,
                             boolean https) {
        log.debug("HttpClient.startSession(String,int,Credentials,boolean):
Host:" +
                  host + " Port:" + port + " Credentials:" + creds +
                  " HTTPS:" + https);
        getState().setCredentials(null,creds);
        connection = new HttpConnection(host,port,https);
    }


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper at LevelSeas for the presence of computer viruses.

**********************************************************************

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message