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 218701 - Using hint "Invert if" twice doesn't undo itself
Summary: Using hint "Invert if" twice doesn't undo itself
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 7.3
Hardware: PC Linux
: P3 normal (vote)
Assignee: Jan Lahoda
URL:
Keywords:
: 218855 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-09-20 12:43 UTC by lutz.horn
Modified: 2012-10-27 01:33 UTC (History)
1 user (show)

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 lutz.horn 2012-09-20 12:43:45 UTC
In build 201209200001 the hint "Invert if" doesn't undo itself.

Example:

boolean b;

if (b) {
} else {
}

Using "Invert if" on the "if" statement adds a "!" in from of the condition:

if (!b) {
} else {
}

Using "Invert if" again on the "if" statement adds a second "!":

if (!!b) {
} else {
}

Expected behaviour: the first "!" is removed and the code reverts to the initial state.
Comment 1 Jan Lahoda 2012-09-23 06:28:28 UTC
*** Bug 218855 has been marked as a duplicate of this bug. ***
Comment 2 Jan Lahoda 2012-10-26 17:06:06 UTC
Should be better after:
http://hg.netbeans.org/jet-main/rev/f8f0c58800b8
Comment 3 Quality Engineering 2012-10-27 01:33:44 UTC
Integrated into 'main-golden', will be available in build *201210270001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/f8f0c58800b8
User: Jan Lahoda <jlahoda@netbeans.org>
Log: #218701: optimizing the negated condition in invert if suggestion.