Community
Participate
Working Groups
We have a bug for double lone ifs: Given: if (isActive) if (isValid) int i = 0; When: Clean up the code enabling "Raise embeded if into parent if" Expected: if (isActive && isValid) int i = 0; Actual: org.eclipse.text.edits.MalformedTreeException: Range of child edit lies outside of parent edit
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