Menu

#5 Error in RTestRedStyleEditor

open
misc (5)
5
2004-01-18
2004-01-18
No

There are lines like these in testSave():

fStyleEditor.saveChangedStyles(new FileOutputStream(new
File(TMP_FILE_NORMAL)));

This will create a new FileOutputStream, which is not
closed until the garbage collector is cleaning them up.

If for some reason the garbage collector is not run
before the end of the method:
File f = new File(TMP_FILE_NORMAL);
assertTrue(f.delete());
then the f.delete() will fail under Windows, because
you cannot delete a file which is open.

Discussion


Log in to post a comment.

MongoDB Logo MongoDB