You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by bu...@apache.org on 2003/04/29 13:56:34 UTC

DO NOT REPLY [Bug 19424] New: - GetMethod.java checks the "used" flag which cannot be set at this time

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=19424>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=19424

GetMethod.java checks the "used" flag which cannot be set at this time

           Summary: GetMethod.java checks the "used" flag which cannot be
                    set at this time
           Product: Commons
           Version: Nightly Builds
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: HttpClient
        AssignedTo: commons-httpclient-dev@jakarta.apache.org
        ReportedBy: max@linuxtag.org


GetMethod.getResponseBodyAsStream calls HttpMethodBase.checkUsed, which asserts
the flag "used" is "true". But at this time, "used" cannot be true, as "used" is
set to true in HttpMethodBase.processRequest, two lines after readResponse is
called (which in turn calls readResponseBody / readResponseBodyAsStream).

Maybe "requestSent" is the flag which should be checked instead of "used"?

My stack trace: (fragment)

java.lang.IllegalStateException: Not Used.
        at
org.apache.commons.httpclient.HttpMethodBase.checkUsed(HttpMethodBase.java:1642)
        at
org.apache.commons.httpclient.methods.GetMethod.getResponseBodyAsStream(GetMethod.java:309)
        at
org.apache.commons.httpclient.methods.GetMethod.readResponseBody(GetMethod.java:428)
        at
org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1893)
        at
org.apache.commons.httpclient.HttpMethodBase.processRequest(HttpMethodBase.java:2496)
        at
org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1062)
        at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:599)
        at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:497)
        at
org.apache.webdav.lib.WebdavResource.getMethodData(WebdavResource.java:2227)
        at
org.apache.webdav.lib.WebdavResource.getMethodData(WebdavResource.java:2206)
[...]