Hi Horche. Welcome to the Ranch!
Anyway, I assume Factory.java line 29 corresponds to line 12 in that listing? In that case, the problem is that the argument array doesn't have two entries. Maybe
you should print out the array to check what it does actually contain. How are you executing the program?