You would certainly think that the code you wrote would create an infinite loop, but strangely enough it does not. It turns out that integers in Java have a limited range. Once the loop variable reaches 2,147,483,647, when you add one more to it, the variable's value wraps around to a large negative number (-2,147,483,648), at which point the loop will stop.
However, it is quite possible to create an infinite loop. Just change your update step from
infinite=1, to keep setting the variable back to 1.