Skip to content
Snippets Groups Projects
Commit d5331476 authored by srosse's avatar srosse
Browse files

OO-103: fix IndexOutOfBoundsException if all context entries are ignorable

parent 449c2a32
No related branches found
No related tags found
No related merge requests found
...@@ -723,18 +723,20 @@ public class UserActivityLoggerImpl implements IUserActivityLogger { ...@@ -723,18 +723,20 @@ public class UserActivityLoggerImpl implements IUserActivityLogger {
// store the current logging object in the session - for duration calculation at next log // store the current logging object in the session - for duration calculation at next log
// session_.putEntry(USESS_KEY_USER_ACTIVITY_LOGGING_LAST_LOG, logObj); // session_.putEntry(USESS_KEY_USER_ACTIVITY_LOGGING_LAST_LOG, logObj);
if (resourceInfos!=null && resourceInfos.size()!=0) { if(resourceInfos != null) {
// this should be the normal case - we do have LoggingResourceables which we can log //remove all ignorable resources
// alongside the log message
// check if we have more than 4 - if we do, issue a log and remove the middle ones
for(Iterator<ILoggingResourceable> riIterator=resourceInfos.iterator(); riIterator.hasNext(); ) { for(Iterator<ILoggingResourceable> riIterator=resourceInfos.iterator(); riIterator.hasNext(); ) {
if(riIterator.next().isIgnorable()) { if(riIterator.next().isIgnorable()) {
riIterator.remove(); riIterator.remove();
} }
} }
}
if (resourceInfos!=null && resourceInfos.size()!=0) {
// this should be the normal case - we do have LoggingResourceables which we can log
// alongside the log message
if (resourceInfos.size()>4) { if (resourceInfos.size()>4) {
log_.warn("More than 4 resource infos set on a user activity log. Can only have 4. Having: "+resourceInfos.size()); log_.warn("More than 4 resource infos set on a user activity log. Can only have 4. Having: "+resourceInfos.size());
int diff = resourceInfos.size()-4; int diff = resourceInfos.size()-4;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment