Bug 535440 - Join 'if' statement with outer 'if' statement should keep comments for outer 'if'
Summary: Join 'if' statement with outer 'if' statement should keep comments for outer ...
Status: CLOSED DUPLICATE of bug 250142
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.7.3   Edit
Hardware: PC Windows 7
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-06-01 04:40 EDT by Andreas Höhmann CLA
Modified: 2018-06-05 04:11 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Höhmann CLA 2018-06-01 04:40:14 EDT
I have this code

if (getTabCount() != 0) {
  // if nothing is selected then select the first tab
  if (tabContentPanel.getContent() == null) {
    setSelectedTab(0);
  }
}

I do a quickfix to join the two if's and the result is this

if (getTabCount() != 0 && tabContentPanel.getContent() == null) {
  setSelectedTab(0);
}

which is correct from a javacode point of view :)

But I lost my comment. It would be nice to keep this comment so I expect the following result

if (getTabCount() != 0 && tabContentPanel.getContent() == null) {
  // if nothing is selected then select the first tab
  setSelectedTab(0);
}
Comment 1 Jay Arthanareeswaran CLA 2018-06-04 09:38:45 EDT
NOt sure who the culprit is, UI or AST rewrite. Copying Manoj and Noopur just in case.
Comment 2 Noopur Gupta CLA 2018-06-05 04:11:11 EDT

*** This bug has been marked as a duplicate of bug 250142 ***