-
Bug
-
Resolution: Fixed
-
P3
-
5.0
-
b18
-
sparc
-
solaris_8
-
Not verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2153606 | OpenJDK6 | Chris Hegarty | P3 | Resolved | Fixed | b01 |
Name: akR10050 Date: 08/26/2003
URL.openConnection is the only way to get an instance of a URLConnection. Since
1.5 there are new methods which can influence the process of establishing
connection (for example, setConnectTimeout). Because of that, it should be
explicitly specified that openConnection method of URL class does not in fact
establish a connection (as the verb "open" implies), but rather instantiate
appropriate URLConnection class and return an unconnected URLConnection.
Here is what specification for URL.openConnection() states at the moment:
-----------------------------------
Returns a URLConnection object that represents a connection to the remote object
referred to by the URL.
A new connection is opened every time by calling the openConnection method of
the protocol handler for this URL.
-----------------------------------
The above wording is very confusing because reader might think that the returned
connection is already opened (i.e. actual connection to the remote socket is
attempted). Possibility of IOException and unclear exception specification are
yet another reasons to believe that the connection is actually established.
The RI returns unconnected URLConnection (at least for HTTP).
======================================================================
URL.openConnection is the only way to get an instance of a URLConnection. Since
1.5 there are new methods which can influence the process of establishing
connection (for example, setConnectTimeout). Because of that, it should be
explicitly specified that openConnection method of URL class does not in fact
establish a connection (as the verb "open" implies), but rather instantiate
appropriate URLConnection class and return an unconnected URLConnection.
Here is what specification for URL.openConnection() states at the moment:
-----------------------------------
Returns a URLConnection object that represents a connection to the remote object
referred to by the URL.
A new connection is opened every time by calling the openConnection method of
the protocol handler for this URL.
-----------------------------------
The above wording is very confusing because reader might think that the returned
connection is already opened (i.e. actual connection to the remote socket is
attempted). Possibility of IOException and unclear exception specification are
yet another reasons to believe that the connection is actually established.
The RI returns unconnected URLConnection (at least for HTTP).
======================================================================
- backported by
-
JDK-2153606 URL.openConnection should specify that the connection returned is unconnected
-
- Resolved
-