Project

General

Profile

Actions

Defect #1673

closed

Provisioning break removing from cache throw null pointer

Added by Ondřej Kopr over 5 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Ondřej Kopr
Category:
Provisioning
Target version:
Start date:
05/21/2019
Due date:
% Done:

100%

Estimated time:
Affected versions:
Owner:

Description

During removing expired items form provisioning break cache may throw exception will null pointer:

java.lang.NullPointerException: null
        at java.util.LinkedList$ListItr.next(LinkedList.java:893)
        at java.util.Collection.removeIf(Collection.java:414)
        at eu.bcvsolutions.idm.acc.dto.SysProvisioningBreakItems.removeOlderRecordsThan(SysProvisioningBreakItems.java:72)

This null pointer is throw in method next

Next method implementation

public E next() {
    checkForComodification();
    if (!hasNext())
        throw new NoSuchElementException();

    lastReturned = next;
    next = next.next;
    nextIndex++;
    return lastReturned.item;
}

Problem is only when two thread entry this method and both execute check hasNext() before one of them entry into line with next = next.next; This issues is very hard to simulate. And probably only way is add synchronized list or synchronized block to processor that call this cache.

Affected version: all version where exists provisioning break.


Files

err.png (219 KB) err.png Ondřej Kopr, 05/23/2019 08:09 AM
Actions

Also available in: Atom PDF