Monday, April 09, 2007

You're my favorite (Java) mistake

The most stupid mistake in Java I made (at least for this year):

Reading a (URLConnection) stream using a BufferedReader while it is ready(), instead of until readLine() returns null.

I wonder what led me to it...
Well, it is a bad idea - very bad, indeed.
Especially a Reader from a 3MB URLConnection is more !ready() then ready(), so it quite frequently terminated (silently) before its time.

Stupid, stupid, stupid, ...

No comments: