Menu

#2 ArrayIndexOutOfBoundsException in getMessageByUID()

open
nobody
None
5
2005-12-16
2005-12-16
No

In MaildirFolder.getMessagesByUID():

if (Arrays.binarySearch(sortedUidArray, uid) >= 0) {
msgs[i] = (Message) uniqToMessageMap.get(uniq);
}

should be using the result from binarySearch() as the
index into msgs[] as follows:

int j;
if ((j = Arrays.binarySearch(sortedUidArray, uid)) >= 0) {
msgs[j] = (Message) uniqToMessageMap.get(uniq);
}

Otherwise calling getMessageByUID() throws
ArrayIndexOutOfBoundsException.

Discussion


Log in to post a comment.

MongoDB Logo MongoDB