Bug 487681 - [refactoring] "invert 'if' statement" does not invert condition
Summary: [refactoring] "invert 'if' statement" does not invert condition
Status: NEW
Alias: None
Product: JSDT
Classification: WebTools
Component: General (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 8
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Victor Rubezhny CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-11 11:18 EST by Adrian Price CLA
Modified: 2016-02-11 11:18 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Adrian Price CLA 2016-02-11 11:18:44 EST
Observed in Enide 2015, based on Eclipse 4.5.0 with org.eclipse.wst.jsdt.feature_1.6.200.v201505071819:

Inverting the following 'if' statement:

if (x)
  doSomething();
else
  doSomethingElse();

results in:

if (x)
  doSomethingElse();
else
  doSomething();


The 'if' condition remains unchanged; it should be refactored to:

if (!x)
  ...