Fix dead cpu loop in getLastEvent
Fix dead cpu loop in ComplexEventChunk.getLastEvent
@@ -104,7 +104,8 @@ public class ComplexEventChunk<E extends ComplexEvent> implements Iterator<E>, S
private E getLastEvent(E complexEvents) {
E lastEvent = complexEvents;
- while (lastEvent != null && lastEvent.getNext() != null) {
+ while (lastEvent != null && lastEvent.getNext() != null
+ && lastEvent.getNext() != complexEvents) {
lastEvent = (E) lastEvent.getNext();
}
return lastEvent;
