Question on Effective Java Item 27



In Joshua Bloch's Effective Java, Item 27 ("Return zero-length arrays,
not nulls"), he concludes with the following words:

"In summary, there is no reason ever to return null from an
array-valued method instead of returning a zero-length array."

I'm not convinced this is correct.

For example, let's say I have a look-up method for some data:

byte[] findData(Object key);

Surely in this case a zero-length returned value could be meaningful in
itself, and so in this case we should return either null, or throw an
exception, if an invalid key was used.

Any thoughts?

.