Updated URLEncodedQueryString
Michael McMahon
Michael.McMahon at Sun.COM
Fri Aug 3 01:22:10 PDT 2007
Richard Kennard wrote:
> Chris,
>
> Thanks for your feedback. And actually, picky is good! I much prefer
> picky feedback to no feedback at all.
>
> I have updated the JavaDoc with your suggestions:
>
>
> https://jdk-collaboration.dev.java.net/servlets/ProjectForumMessageView?messageID=20922&forumID=1463
>
>
> However, on the question of...
>
> > How about [getParameterValues] returning an empty list if the
> parameter does not exist?
>
> ...I guess this comes down to whose behaviour it makes more sense to
> model. Do we model the behaviour of getParameterNames, as you suggest,
> and return an empty List, or do we model the behaviour of
> getParameterValue (it's non-plural version) and return null if the
> parameter does not exist?
>
> I've leaned towards the latter, but I am open to reasons to lean
> toward the former.
>
I agree with Chris. It is generally thought to be better practice to
return empty collection objects
rather than null. It means that calling code often does not need special
handling for this case.
We should finalize the spec soon. I will submit it to the CCC on Tuesday
next week, unless
there are any further issues raised before then. Monday is a holiday here.
Thanks
Michael
More information about the net-dev
mailing list