JDK-6332756 : (ch) Implementation of java.nio.channels.FileLock class does not match its specification
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.nio
  • Affected Version: 1.4.0,6
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic,solaris
  • CPU: generic
  • Submitted: 2005-10-05
  • Updated: 2018-02-01
  • Resolved: 2005-12-03
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.
JDK 6
6 b63Fixed
Related Reports
Duplicate :  
Relates :  
Description
The specification of java.nio.channels.FileLock says "The locks held on a particular
file by a single Java virtual machine do not overlap.", but it's implementation only
guarantees that he locks held on a particular file by a single FileChanngel object do
not overlap", a serious spec violation. See Comments.

Comments
SUGGESTED FIX http://sunweb.ireland/~ab23780/6332756/webrev/index.html
25-11-2005

EVALUATION The description is correct and the check for the overlapping of file locks was not completely implemented. Fixing this issue is straight-forward but it introduces a behaviour change for applications that do locking with multiple channels to the same file. While the behaviour change is significant, we not expect there it will impact many applications (if any). However it is a change that will need to be considered. The change also requires the addition of a system property to specify 1.4/5.0 behaviour as a fallback in the event of application breakage.
05-10-2005