Summary: | [cleanup] "Raise embedded if into parent if" cleanup crashes with double lone ifs with ending comment | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Fabrice Tiercelin <fabrice.tiercelin> |
Component: | UI | Assignee: | Fabrice Tiercelin <fabrice.tiercelin> |
Status: | VERIFIED FIXED | QA Contact: | Carsten Hammer <carsten.hammer> |
Severity: | normal | ||
Priority: | P3 | ||
Version: | 4.17 | ||
Target Milestone: | 4.18 M3 | ||
Hardware: | All | ||
OS: | All | ||
See Also: |
https://git.eclipse.org/r/c/jdt/eclipse.jdt.ui/+/171577 https://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=e47bcb5fd414abcd2cf5a7b765dc8f01c398e8cf |
||
Whiteboard: | |||
Bug Depends on: | 566870 | ||
Bug Blocks: |
Description
Fabrice Tiercelin
2020-10-05 17:23:51 EDT
Actually, it is not due to the lone statement, it is due to an ending comment: if (isActive) if (isValid) int i = 0; // foo This can be fixed when cleanup will be multi-pass. This is planned: Bug 566870. The idea is that when we encounter two embedded lone if statements, we only add bracket to the parent if. Doing this, the second pass will correctly cleanup the code (without bracket). So the code will be cleanup in two passes. New Gerrit change created: https://git.eclipse.org/r/c/jdt/eclipse.jdt.ui/+/171577 Gerrit change https://git.eclipse.org/r/c/jdt/eclipse.jdt.ui/+/171577 was merged to [master]. Commit: http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=e47bcb5fd414abcd2cf5a7b765dc8f01c398e8cf Verified for 4.18M3 using I20201116-1800 build |