JDK-7105952 : Improve finalisation for FileInputStream/FileOutputStream/RandomAccessFile
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.io
  • Affected Version: 6-pool,7,8
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2011-10-28
  • Updated: 2018-05-16
  • Resolved: 2012-05-09
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
7u6Fixed 8 b15Fixed
Related Reports
Duplicate :  
Duplicate :  
Relates :  
Relates :  
Relates :  
Relates :  
Finalisation for FileInputStream/FileOutputStream/RandomAccessFile streams that share the same native FileDescritor needs improvement. Currently a counter is used to keep track of streams which reference the same native FD. A close() on one of the streams means other streams are not properly notified of the event.

Best approach is to modify fileDescriptor so that FileInputStream/FileOutputStream/RandomAccessFile classes can register with them and ensure streams are correctly closed out at close() time or when finalizer gets to run.

EVALUATION modify FileDesriptor so that it keeps track of all its parents/referents and takes appropritate measures at close time.