The code you provide a link to doesn't seem to be the code for ArrayList that is inherent to Java. The API for ArrayList specifies the default capacity is 10, where as the code you link to sets the default to 16. Are you using the code you link to or the implementation Java provides for you? (It may not make any difference to this problem however)
Are you using the ArrayList.size() method to determine if the length is 42? If so, you should find that the size method reports only how many items are in the current arraylist, not how many it can hold.
Thus, the following should always print 0:
ArrayList al = new ArrayList(42);
System.out.println(al.size());
ArrayList seems to act a lot like a Vector, which means it's capacity can grow, so my feeling is the initial capacity should be of minimal importance.
Greetings.