FULL PRODUCT VERSION :
1.4.2_10, 5.0_06 and 6.0_71
ADDITIONAL OS VERSION INFORMATION :
windows XP with SP2(simple chinese)
A DESCRIPTION OF THE PROBLEM :
On closing a FileOutputStream to a file, the file associated with the FileOutputStream is not released and it cannot be deleted.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Run the code.
2. Try to delete the file
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
file can be delete.
ACTUAL -
OS prompt error a diaglog, can't find the file.and suggest to user search tools to confirm is filename.
ERROR MESSAGES/STACK TRACES THAT OCCUR :
Windows - Opens a popup window saying file cannot be deleted
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
public class Test
{
public static void main(String[] args) throws InterruptedException, IOException
{
File file = new File("c:\\a.txt");
FileOutputStream fos = new FileOutputStream(file);
fos = new FileOutputStream(file);
fos.close();
while(true)
{}
}
}
---------- END SOURCE ----------
1.4.2_10, 5.0_06 and 6.0_71
ADDITIONAL OS VERSION INFORMATION :
windows XP with SP2(simple chinese)
A DESCRIPTION OF THE PROBLEM :
On closing a FileOutputStream to a file, the file associated with the FileOutputStream is not released and it cannot be deleted.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Run the code.
2. Try to delete the file
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
file can be delete.
ACTUAL -
OS prompt error a diaglog, can't find the file.and suggest to user search tools to confirm is filename.
ERROR MESSAGES/STACK TRACES THAT OCCUR :
Windows - Opens a popup window saying file cannot be deleted
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
public class Test
{
public static void main(String[] args) throws InterruptedException, IOException
{
File file = new File("c:\\a.txt");
FileOutputStream fos = new FileOutputStream(file);
fos = new FileOutputStream(file);
fos.close();
while(true)
{}
}
}
---------- END SOURCE ----------