Possible for IndexOutOfBoundsException if user has made a friend request but their account has been removed

Description

There is the possibility for an indexoutofboundsexception if a user makes a friend request but then their account is removed as it will return a false number in the count, but the real list will be less and the subList statement will throw the exception.

java.lang.IndexOutOfBoundsException: toIndex = 1
at java.util.SubList.<init>(AbstractList.java:602)
at java.util.RandomAccessSubList.<init>(AbstractList.java:758)
at java.util.AbstractList.subList(AbstractList.java:468)
at org.sakaiproject.profile2.tool.dataproviders.RequestedFriendsDataProvider.iterator(RequestedFriendsDataProvider.java:65)

The issue here is that the requestedFriendsCount goes directly to the db rather than through the UDS filter like the confirmed friends count does.

Activity

Show:

Hudson CI Server November 14, 2011 at 4:41 PM

Integrated in profile2 trunk #514 (See http://builds.sakaiproject.org:8080/job/profile2%20trunk/514/)
fix for requested friends count to not go directly to the db, as this can cause issue if users have been removed

Steve Swinsburg November 14, 2011 at 4:35 PM

1.4.x r100720

Steve Swinsburg November 14, 2011 at 4:29 PM

r100719

Fixed

Details

Priority

Affects versions

Fix versions

Components

Assignee

Reporter

Created November 14, 2011 at 4:13 PM
Updated February 4, 2015 at 2:24 PM
Resolved November 14, 2011 at 4:29 PM