If you don't pass in any arguments then you're trying to access element -1 of the array, which will cause an exception.
Also, Integer.valueOf is unnecessary unless you're using some ancient version of
Java (see autoboxing).
edit: never mind, I too was confusing this Integer.valueOf(
String) method with Intger.valueOf(int) - the latter of which is a waste of space since the compiler in Java 5 or later does it for you.