dfa: don't grow stack infinitely on &= (IDEA-118522)

This commit is contained in:
peter
2013-12-22 10:39:55 +01:00
parent a8861db9c9
commit 1dd46651c9
3 changed files with 14 additions and 4 deletions
@@ -0,0 +1,11 @@
import java.util.List;
class Some {
public static void appendTokenTypes(StringBuilder sb, List<String> tokenTypes) {
for (int count = 0, line = 0, size = tokenTypes.size(); count < size; count++) {
boolean newLine = count == 2 || <warning descr="Condition 'line > 0' is always 'false' when reached">line > 0</warning> && (count - 2) % 6 == 0;
newLine &= (size - count) > 2;
}
}
}