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 262558 - Incorrect hint "Unused Assignment" in loop with continue
Summary: Incorrect hint "Unused Assignment" in loop with continue
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 8.1
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-23 23:56 UTC by matthies
Modified: 2016-07-14 01:50 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description matthies 2016-06-23 23:56:33 UTC
Example:

    void foo(boolean condition) throws RuntimeException
    {
        while (true)
        {
            RuntimeException rex = null;

            if (condition)
            {
                try {
                    // something
                    continue;
                }
                catch (RuntimeException ex)
                {
                    rex = ex;  // (*)
                }
            }
            
            // more code here

            throw rex;
        }
    }

The hint is incorrectly shown for the line marked with (*).

(This is a minimal example, the real code actually makes sense ;).)
Comment 1 Svata Dedic 2016-07-01 15:56:32 UTC
Fixed in jet-main#a5658de381eb
Comment 2 Quality Engineering 2016-07-14 01:50:49 UTC
Integrated into 'main-silver', will be available in build *201607140002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/a5658de381eb
User: Svata Dedic <sdedic@netbeans.org>
Log: #262558: accept passing through method parameter or exception parameter