findepi commented on code in PR #4863:
URL: https://github.com/apache/iceberg/pull/4863#discussion_r883420763


##########
core/src/main/java/org/apache/iceberg/util/Tasks.java:
##########
@@ -205,11 +215,12 @@ private <E extends Exception> boolean runSingleThreaded(
       List<I> succeeded = Lists.newArrayList();
       List<Throwable> exceptions = Lists.newArrayList();
 
-      Iterator<I> iterator = items.iterator();
+      Preconditions.checkState(!hasStarted, "Cannot run twice");
+      hasStarted = true;

Review Comment:
   Should i also reference `hasStarted` with `this.` in the checkState above?
   
   should i also reference `items` with `this.` when calling `.next()`? (this 
is a mutation after all)
   
   Please advise what should i do.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to