diff --git a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/block/CodeBlockIterator.java b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/block/CodeBlockIterator.java index d6b293af3a..ea6ba3d10f 100644 --- a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/block/CodeBlockIterator.java +++ b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/block/CodeBlockIterator.java @@ -15,26 +15,63 @@ */ package ghidra.program.model.block; +import java.util.Iterator; + import ghidra.util.exception.CancelledException; +import ghidra.util.task.TaskMonitor; import util.CollectionUtils; /** * An iterator interface over CodeBlocks. * + *
Note: this iterator is also {@link Iterable}. The {@link #hasNext()} and {@link #next()}
+ * methods of this interface throw a {@link CancelledException} if the monitor is cancelled. The
+ * iterator returned from {@link #iterator()} does not throw a cancelled exception. If
+ * you need to know the cancelled state of this iterator, then you must check the cancelled state
+ * of the monitor passed into this iterator via the {@link CodeBlockModel}. See
+ * {@link TaskMonitor#isCancelled()}.
+ *
* @see ghidra.program.model.block.CodeBlock
* @see CollectionUtils#asIterable
- */
-public interface CodeBlockIterator {
+ */
+public interface CodeBlockIterator extends Iterable