Leo Li 写道:
Hi, all
While cleaning the jira 1687, I found that the spec says if connected,
both functions should throw IllegalStateException, while RI throws it in
HttpURLConnection.getRequestProperties() but
HttpURLConnection.getRequestProperty(String) not.
Although personally I would like not to throw exception in both cases
I am not sure whether throw Exceptions or return null value is better.
They demonstrates different error handling mechanism.
Now that, we could not predict which mechanism users will adopt, follow
RI's behavior is safer.
Best regards
since it will not do harm to get properties for request after
connected, I
will still follow RI although the manner is a little odd if no one
objects.
Leo Li
China Software Development Lab, IBM
--
Spark Shen
China Software Development Lab, IBM