The linked java test file, http://igm.univ-mlv.fr/~pivoteau/Timsort/Test.java - still crashes the latest Java 10.0.2 with an 'Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 49'. Amazing! I wonder if this makes some web services vulnerable.. if the user can submit a just-so array of ints to be sorted? But it does seem like it would require uploading a really huge array (>4GB?)
arrayToSort[sum] = 1;
This is just blatant programmer error. The code is attempting to assign a value to a slot in an array of a fixed size, which does not exist.Use:
Integer[] arrayToSort = new Integer[2000000000];
No error.