JDK-5053766 : HttpRetryException should be specified for getInputStream()
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 5.0
  • Priority: P5
  • Status: Closed
  • Resolution: Won't Fix
  • OS: generic
  • CPU: generic
  • Submitted: 2004-05-27
  • Updated: 2017-11-01
  • Resolved: 2017-11-01
Related Reports
Relates :  
Description

Name: vpR10197			Date: 05/27/2004


The specification for the HttpURLConnection.setChunkedStreamingMode() and
HttpURLConnection.getFixedLengthStreamingMode() methods says:

    When output streaming is enabled, authentication and
    redirection cannot be handled automatically. A HttpRetryException
    will be thrown when reading the response if authentication or
    redirection are required

Inspite of the spec of getInputStream() passes over this exception in sielence,
it could be interpreted like this:

    ....A HttpRetryException will be thrown during first invocation
    of getInputStream() if...
(note: this phrase does not pretend to be a part of specification, it is
just an example)

Indeed, HttpRetryException is thrown on client side during getting an
input stream and tests should consider that as an expected behaviour.
Perhaps, this behaviour should be more precisely described, at least
HttpRetryException must be mentioned in the exceptions list thrown
by getInputStream.

One more inaccuracy: <jdk_doc>/api/java/net/class-use/HttpRetryException.html
shows the 'No usage of java.net.HttpRetryException' message that does not
correspond to the implementation.
======================================================================

Comments
No recent interest or activity.
01-11-2017

EVALUATION getInputStream is specified in java.net.URLConnection to throw IOException and HttpRetryException is a sub-class of IOException. We would have to override getInputSTream in HttpURLConnection in order to document this. I am not convinced this is necessary because anyone who uses this feature has to set the chunked/streaming output mode and the behavior is documented in those methods. ###@###.### 2004-06-21
21-06-2004