harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Spark Shen <smallsmallor...@gmail.com>
Subject Re: [classlib][luni]HttpURLConnection.getRequestProperty(String) and HttpURLConnection.getRequestProperties() should throw IllegalStateException while connected or not?
Date Thu, 02 Nov 2006 05:38:35 GMT

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


Mime
View raw message