title: File.renameTo() fails
body: <p>I have eclipse plugin jface application.
  A thread writes file via BufferedWriter.
  After writing is done I close the buffer after that I try to rename the file. </p>
  
  <p>But sometimes file is not renamed!</p>
  
  <p>I tried to add some Thread.Sleep(BIG_NUMBER) between couple of retries this didn't help.</p>
  
  <p>It looks like the file getting some kind of lock. (when I kill the jvm I can rename the file).</p>
  
  <p>Is there something I can do?</p>
  
  <p>OS: Windows XP, windows 7
  JAVA version: 1.5</p>