David Mollitor created KAFKA-9419:
-------------------------------------

             Summary: Integer Overflow Possible with CircularIterator
                 Key: KAFKA-9419
                 URL: https://issues.apache.org/jira/browse/KAFKA-9419
             Project: Kafka
          Issue Type: Improvement
            Reporter: David Mollitor


Very unlikely to happen, but as someone that gets called in when something goes 
wrong, I'd like to remove as many possibilities as possible.

 

[https://github.com/apache/kafka/blob/8c21fa837df6908d9147805e097407d006d95fd4/clients/src/main/java/org/apache/kafka/common/utils/CircularIterator.java#L39-L43]

 

Also, the current implementation will work with a LinkedList, but it won't work 
well.  The constant call to `get(i)` will perform at O(n^2).  Using an iterator 
instead allows other Collections to work reasonably well.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to