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

Summary: Incorrect hint "Unused Assignment" in loop with continue
Product: java Reporter: matthies <matthies>
Component: HintsAssignee: Svata Dedic <sdedic>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P3    
Version: 8.1   
Hardware: PC   
OS: Windows 7   
Issue Type: DEFECT Exception Reporter:

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