Possible for IndexOutOfBoundsException if user has made a friend request but their account has been removed
GENERAL
TESTING
GENERAL
TESTING
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.
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.