At work we’ve been stung (fortunately on an internal system only) by a JDK bug which we weren’t aware of. Did you know that under JDK1.4.1 once 2036 files are open any subsequent opens will delete the file that was supposed to be opened? Obviously this is NOT WHAT WAS SUPPOSED TO HAPPEN!! Note that the file that gets deleted could be a class, a jar or something like web.xml - it gets deleted! Tracking down THAT bug was NOT FUN. We found it in a web-app. It was behaving weirdly, so I attempted to restart it, which meant the web.xml was re-read, and deleted!
See http://developer.java.sun.com/developer/bugParade/bugs/4779905.html for the gory details and a test case.
Even if you are careful with making sure you close your files, you can never be sure about 3rd party components.
Fortunately, experimentation has show that it seems to be fixed in JDK1.4.2 - although the bug isn’t marked as closed. Nice to see Sun keeps track of what bugs they fix…