[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jakarta-commons-dev
Subject:    HttpClient bug?
From:       Nathan Coast <nathan.coast () levelseas ! com>
Date:       2001-11-29 16:45:10
[Download RAW message or body]

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>

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic