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 254101 - Incorrect "The branch is never used" hint
Summary: Incorrect "The branch is never used" hint
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 8.0.2
Hardware: PC Windows 8.1
: P3 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-03 07:52 UTC by in-ws5
Modified: 2015-09-17 01:26 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 in-ws5 2015-08-03 07:52:38 UTC
The following code in java will print "true" in the console when compiled and run in netbeans.

public class Simple {
    public static void main(String[] args) throws Exception {
        boolean var1 = true;
        if (var1 |= false) {
            System.out.println(var1);
        }
    }
}

However, the editor shows the hint "The branch is never used" on the line with the if statement.
Comment 1 Jiri Prox 2015-08-10 10:27:11 UTC
Reproducible
Comment 2 Svata Dedic 2015-09-14 10:39:07 UTC
Fixed in jet-main#e01dbf9549e1
Comment 3 Quality Engineering 2015-09-17 01:26:33 UTC
Integrated into 'main-silver', will be available in build *201509170002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/e01dbf9549e1
User: Svata Dedic <sdedic@netbeans.org>
Log: #254101: compound assignment cannot provide right operand as result value