ArrayList.add throws ArrayIndexOutOfBoundsException [duplicate]
This question already has answers here : What are the possible problems caused by adding elements to unsynchronized ArrayList's object by multiple threads simultaneously? (4 answers) What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? (25 answers) I am trying to add a object to a ArrayList and its throwing ArrayIndexOutOfBoundsException Following is the code private void populateInboxResultHolder(List inboxErrors){ inboxList = new ArrayList(); try{ inboxHolder = new InboxResultHolder(); //Lots of Code inboxList.add(inboxHolder); }catch(Exception e){ e