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.

Bug 186434 - Hint "Lock.unlock() not unlocked in finally" is trying to be too smart
Summary: Hint "Lock.unlock() not unlocked in finally" is trying to be too smart
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P3 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-20 13:24 UTC by Leos.Bitto
Modified: 2013-09-02 14:21 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Leos.Bitto 2010-05-20 13:24:17 UTC
This is my code (waiting until other thread calls lock.unlock()) where I believe that the hint "Lock.unlock() not unlocked in finally" should not be used:

                        lock.lock();
                        lock.unlock();

This is what the hint suggests:

                        lock.lock();
                        try {
                        } finally {
                            lock.unlock();
                        }
Comment 1 Quality Engineering 2010-08-07 03:34:50 UTC
Integrated into 'main-golden', will be available in build *201008070001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/7ced86de6cb2
User: Jan Lahoda <jlahoda@netbeans.org>
Log: #186434: lock(); unlock(); should not trigger "missing try-finally" warning.