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 241808 - "The assigned value is never used" wrong
Summary: "The assigned value is never used" wrong
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 7.3
Hardware: PC Windows 7
: P2 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-13 09:41 UTC by mirzahad
Modified: 2014-02-20 03:03 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 mirzahad 2014-02-13 09:41:39 UTC
In this block of code, on 10th line (i = ii) is yellow warning, "The assigned value is never used", but it is wrong:

        int[] arr = new int[] {1, 2, 3, 4};
        int di = 0;
        do {
            int i = di;
            do {
                int ii = arr[i];                
                if (ii == 4) {
                    break;                    
                } else {
                    i = ii;
                }
            } while(true);
        } while(++di < 4);
Comment 1 Svata Dedic 2014-02-17 15:50:34 UTC
Should be fixed by jet-main#b7e47b4acd06
testcase for the code in the issue description added.
Comment 2 Quality Engineering 2014-02-20 03:03:44 UTC
Integrated into 'main-silver', will be available in build *201402200001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/b7e47b4acd06
User: Svata Dedic <sdedic@netbeans.org>
Log: #241808: fixed unused reports for do-while loops