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 250476 - comment lost with fix on hint "if statement is redundant"
Summary: comment lost with fix on hint "if statement is redundant"
Status: VERIFIED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 8.0.2
Hardware: PC Windows 7
: P2 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-17 20:31 UTC by err
Modified: 2015-04-01 15:02 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 err 2015-02-17 20:31:09 UTC
public boolean foo(int x)
    {
        if (10 == x) {
            return false;
        }

        // BUG: applying fix to following looses THIS comment

        if (20 != x) {   // <<<<<<<<< hint "if statement is redundant"
            return false;
        }

        return true;
    }
Comment 1 Svata Dedic 2015-02-27 09:00:54 UTC
Confirmed the defect is present in 8.0.2 release. The transformation works OK in the current dev version; I suppose the behaviour could be improved by fixes for issue #246871 and issue #246059.