On Apr 4, 2006, at 10:23 AM, Andrzej Bialecki wrote:

Owen O'Malley wrote:

On Apr 4, 2006, at 3:48 AM, Andrzej Bialecki wrote:

Shouldn't this method throw an IOException, as it is declared in Closeable?

Yes, it should. Thanks for the catch Andrzej.

What is interesting is that javac didn't catch it either... strange. I need to read a good book on Java basics, it seems. ;)

The throws clauses are allowed to be different in an implementation as long as it is stricter. In this case, throwing nothing is more strict than throwing IOException, so it is ok.

-- Owen

Reply via email to