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 198652 - Flow wrong for some statements
Summary: Flow wrong for some statements
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 7.1
Hardware: PC Linux
: P3 normal (vote)
Assignee: Jan Lahoda
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-16 19:18 UTC by Jan Lahoda
Modified: 2011-06-02 21:05 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 Jan Lahoda 2011-05-16 19:18:14 UTC
[recent sources]

Consider this:
----------
package flowtest;

public class Flowtest {

    public void i() {
        int i;
        
        try {
            i = 1;
        } catch (Exception e) {
            i = 2;
        }
        
        System.err.println(i);
    }
    
}
----------

"1" will be marked as unused, which is incorrect.
Comment 1 Quality Engineering 2011-05-17 10:06:05 UTC
Integrated into 'main-golden', will be available in build *201105170400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/ac203383cc84
User: Jan Lahoda <jlahoda@netbeans.org>
Log: #198652: better handling of try-catch-finally in flow.
Comment 2 Jan Lahoda 2011-05-17 16:09:21 UTC
Another example:
-----------
    public void main(String[] args) {
        int i;
        
        switch (args.length) {
            case 0: i = 0; break;
            case 1: i = 1; break;
            case 2: i = 2; break;
            default: i = 3; break;
        }
        
        System.err.println(i);
    }
-----------
Comment 3 Quality Engineering 2011-05-18 08:51:16 UTC
Integrated into 'main-golden', will be available in build *201105180400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/b2575c40a744
User: Jan Lahoda <jlahoda@netbeans.org>
Log: #198652: more correct handling of switch statements.
Comment 4 Quality Engineering 2011-05-24 10:35:15 UTC
Integrated into 'main-golden', will be available in build *201105240400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/52bd7a31f647
User: Jan Lahoda <jlahoda@netbeans.org>
Log: #198652: improving Flow analysis.
Comment 5 Quality Engineering 2011-05-28 12:18:15 UTC
Integrated into 'main-golden', will be available in build *201105280401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/b8cbc0710ebc
User: Jan Lahoda <jlahoda@netbeans.org>
Log: #198652: more flow fixing.
Comment 6 Jan Lahoda 2011-05-31 08:51:19 UTC
Updated Flow pushed into release701 branch:
http://hg.netbeans.org/releases/rev/45663387d032
Comment 7 Quality Engineering 2011-05-31 19:22:09 UTC
Integrated into 'main-golden', will be available in build *201105310954* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/45663387d032
User: Jan Lahoda <jlahoda@netbeans.org>
Log: #198652: more Flow fixes.
Comment 8 Quality Engineering 2011-06-01 13:25:43 UTC
Integrated into 'main-golden', will be available in build *201106010401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/45663387d032
User: Jan Lahoda <jlahoda@netbeans.org>
Log: #198652: more Flow fixes.
Comment 9 Quality Engineering 2011-06-02 21:05:09 UTC
Integrated into 'main-golden', will be available in build *201106021001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/45663387d032
User: Jan Lahoda <jlahoda@netbeans.org>
Log: #198652: more Flow fixes.