I20210730-1800
tagged this
30 Jul 02:57
Replace while by do/while:
- The first evaluation must be always true,
- The first evaluation must be passive.
Given:
boolean isInitedToTrue= true;
while (isInitedToTrue) {
if (i > 100) {
isInitedToTrue= false;
}
i *= 2;
}
When:
Select while loop and perform CTRL+1 to do quick fix...
Then:
boolean isInitedToTrue= true;
do {
if (i > 100) {
isInitedToTrue= false;
}
i *= 2;
} while (isInitedToTrue);
Change-Id: I7c778d6777a5e363e4fc1f2df6c57a57f0d4ff32
Signed-off-by: Fabrice Tiercelin <fabrice.tiercelin@yahoo.fr>
Signed-off-by: Jeff Johnston <jjohnstn@redhat.com>
Reviewed-on: https://git.eclipse.org/r/c/jdt/eclipse.jdt.ui/+/178824
Tested-by: JDT Bot <jdt-bot@eclipse.org>