A DESCRIPTION OF THE PROBLEM :
The sources of java.net.URLConnection suggests that the default connection timeout is set to 0. However, the javadocs on the functions java.net.URLConnection#getConnectTimeout() or java.net.URLConnection#setConnectTimeout(), do not mention this explicitly.
It is mentioned in these methods that a value of 0 will translate to infinite timeout, but it is not mentioned that the value 0 is also the default (as the sources suggest).
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Returns setting for connect timeout. Default is 0.
ACTUAL -
Returns setting for connect timeout.
URL OF FAULTY DOCUMENTATION :
http://docs.oracle.com/javase/7/docs/api/java/net/URLConnection.html#getConnectTimeout()
The sources of java.net.URLConnection suggests that the default connection timeout is set to 0. However, the javadocs on the functions java.net.URLConnection#getConnectTimeout() or java.net.URLConnection#setConnectTimeout(), do not mention this explicitly.
It is mentioned in these methods that a value of 0 will translate to infinite timeout, but it is not mentioned that the value 0 is also the default (as the sources suggest).
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Returns setting for connect timeout. Default is 0.
ACTUAL -
Returns setting for connect timeout.
URL OF FAULTY DOCUMENTATION :
http://docs.oracle.com/javase/7/docs/api/java/net/URLConnection.html#getConnectTimeout()