Sean C. Sullivan wrote: >jakarta-commons httpclient inquiry: > > >Currently, HttpMethod.java (an interface) defines a >method called "getResponseBody": > > /** > * Return my response body, if any, > * as a byte array. > * Otherwise return <tt>null</tt>. > */ > public byte[] getResponseBody(); > > >I would prefer if this method returns a zero-length array instead >of null. > >Returning a zero-length array is one of the API design tips that >is recommended in Josh Bloch's book: > > Effective Java Programming Language Guide > http://www.amazon.com/exec/obidos/ASIN/0201310058/ > > >==> Item 27: Return zero-length arrays, not nulls > Hi Sean,
given I don't have the book handy, this doesn't make for a very convincing argument as to why we should change the API. As well, the current api documents returning null. Which is cheaper from the JVM perspective than creating a new byte array. Can you please provide some more info on why you'd like the change? -- dIon Gillard, Multitask Consulting http://www.multitask.com.au/developers -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
