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 198642 - Flow computation wrong when a constant is in the condition of the if statement
Summary: Flow computation wrong when a constant is in the condition of the if statement
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 15:32 UTC by Jan Lahoda
Modified: 2011-05-31 08: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 Jan Lahoda 2011-05-16 15:32:10 UTC
[recent build]

Consider this source code:
------------
package flowtest;

import java.util.concurrent.atomic.AtomicBoolean;

public class Flowtest {

    public void i() {
        if (!i.getAndSet(true)) {
            System.err.println("");
        }
    }
    
    private final AtomicBoolean i = new AtomicBoolean();
    
}
------------

The 'System.err.println("");' is marked as a dead branch, although it apparently is not.
Comment 1 Quality Engineering 2011-05-17 10:07:12 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/905cfb404055
User: Jan Lahoda <jlahoda@netbeans.org>
Log: #198642: properly reset the visitor return value (i.e. constant boolean expression value) to prevent propagation through method invocations, etc.
Comment 2 Jan Lahoda 2011-05-31 08:50:53 UTC
Updated Flow pushed into release701 branch:
http://hg.netbeans.org/releases/rev/45663387d032