ArrayList.add throws ArrayIndexOutOfBoundsException
2022-09-02 01:03:02
我正在尝试将一个对象添加到ArrayList及其抛出ArrayIndexOutOfBoundsException 以下是代码
private void populateInboxResultHolder(List inboxErrors){
inboxList = new ArrayList();
try{
inboxHolder = new InboxResultHolder();
//Lots of Code
inboxList.add(inboxHolder);
}catch(Exception e){
e.printStackTrace();
}
}
例外是
[3/7/12 15:41:26:715 UTC] 00000045 SystemErr R java.lang.ArrayIndexOutOfBoundsException
[3/7/12 15:41:26:721 UTC] 00000045 SystemErr R at java.util.ArrayList.add(ArrayList.java:378)
[3/7/12 15:41:26:721 UTC] 00000045 SystemErr R at com.ml.fusion.ui.common.web.bean.inbox.InboxSearchBean.populateInboxResultHolder(InboxSearchBean.java:388)
[3/7/12 15:41:26:721 UTC] 00000045 SystemErr R at com.ml.fusion.ui.common.web.bean.inbox.InboxSearchBean.searchInboxErrors(InboxSearchBean.java:197)
[3/7/12 15:41:26:721 UTC] 00000045 SystemErr R at com.ml.fusion.ui.common.web.bean.inbox.InboxSearchBean.viewInbox(InboxSearchBean.java:207)
但根据ArrayList.add的签名,它不应该引发这个异常。请帮忙。