vineri, 26 septembrie 2008

Daily WTF code

sun.net.httpserver.ChunkedInputStream:
while ((c=(char)in.read())!= -1) {


}
What's wrong with this? Nothing much... only a char can never be -1, 'cause its unsigned. So the EOF will never be detected in this code :D