Skip to content

Commit

Permalink
Add Iterator.next() "NoSuchElementException" inspectIT#1167
Browse files Browse the repository at this point in the history
  • Loading branch information
boris-unckel committed Jul 28, 2021
1 parent 2de4921 commit a953119
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import rocks.inspectit.ocelot.core.instrumentation.autotracing.events.TraceEvent;

import java.util.Iterator;
import java.util.NoSuchElementException;

/**
* After a trace is reconstructed from a lsit of {@link TraceEvent},
Expand Down Expand Up @@ -170,6 +171,9 @@ public boolean hasNext() {

@Override
public Invocation next() {
if (!hasNext()) {
throw new NoSuchElementException();
}
Invocation next = current;
current = current.nextSibling;
return next;
Expand Down

0 comments on commit a953119

Please # to comment.