Created
October 13, 2011 18:59
-
-
Save galak-fyyar/1285158 to your computer and use it in GitHub Desktop.
Weird bug in Java(TM) SE Runtime Environment (build 1.6.0_27-b07) Java HotSpot(TM) 64-Bit Server VM (build 20.2-b06, mixed mode)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
class ForBug { | |
public static void main( String[] a ) { | |
int m = Integer.MAX_VALUE; | |
for ( int n = 1; n <= m; n++ ) { | |
System.out.println( "Step " + n ); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For loop in this snippet will end at n == 15588, which obviously not greater that Integer.MAX_VALUE. Looks like it is bug of x64 version only or build. At least on x32 of same version everything works fine.