| Summary: | Lost code after "Pull down common code from if/else statement" clean up | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Dennis <hkdennis2k+eclipse> |
| Component: | Core | Assignee: | JDT-Core-Inbox <jdt-core-inbox> |
| Status: | CLOSED DUPLICATE | QA Contact: | |
| Severity: | critical | ||
| Priority: | P3 | ||
| Version: | 4.19 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Whiteboard: | |||
*** This bug has been marked as a duplicate of bug 571809 *** |
It is a private project and I cannot share code. But In same case, that rule could result in deleted wrong code. Given: ```java if( a < CONST){ foo.bar(); foo.foo(); //many lines line1358(); foobar.clear(); foobar.add(x); something.setVisible(true); } else { if ( a >= Math.abs(CONST) ) { // something } // more code here line1393(); foobar.clear(); foobar.add(x); something.setVisible(true); } ``` Expected: ```java if( a < CONST){ foo.bar(); foo.foo(); //many lines line1358(); } else { if ( a >= Math.abs(CONST) ) { // something } // more code here line1393(); } foobar.clear(); foobar.add(x); something.setVisible(true); ``` Actual: ```java if( a < CONST){ foo.bar(); foo.foo(); //many lines line1358(); } else { if ( a >= Math.abs(CONST) ) { // something } // more code here line1393(); } ```