This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Since we already require JDK 1.7 to compile NetBeans platform, FileLock class could finally implement AutoCloseable to nicely play in try-with-resources clauses.
Created attachment 149888 [details] Proposed changes
Y01 "As JDK 1.7 is required, the FileLock can implement AutoCloseable" - nice explanation of the motivation, but I guess it belongs more into the review issue than into the change description. Just state the fact it implements the interface to be usable in try/catch/with/resources. Y02 Adding final method can be seen as binary incompatible change. Unlikely to cause harm, but consider non-final close() method. Y03 Change one test in the TCK to use the close() method instead of releaseLock(), please.
Created attachment 149892 [details] Revised patch with Y01-3
If there is no further input, I'll integrate on 29/10
Integrated into 'main-silver', will be available in build *201411210001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/5d7691d3f865 User: Svata Dedic <sdedic@netbeans.org> Log: #247915: implemented AutoCloseable support