WidenPlusInLoop: test-case for IDEA-229598 (issue already fixed in 2fdecc05)

GitOrigin-RevId: 23923b7245f250f0e52fda0ad5c664c0c9ff0f1a
This commit is contained in:
Tagir Valeev
2019-12-23 04:02:09 +00:00
committed by intellij-monorepo-bot
parent b346bba10f
commit f8b70c5823
@@ -67,4 +67,27 @@ public class WidenPlusInLoop {
System.out.println(i);
}
}
// IDEA-229598
private static int[] test(int countSections) {
int[] sections = new int[countSections];
if (countSections == 1) {
sections[0] = 0;
} else if (countSections > 1) {
if (countSections % 2 == 0) {
int internalId = -1 * (countSections - 1);
for (int i = 0; i < countSections; i++) {
if (internalId == 1) {
internalId++;
}
sections[i] = Math.abs(internalId);
internalId += 2;
}
}
}
return sections;
}
}