mumrah commented on code in PR #18684:
URL: https://github.com/apache/kafka/pull/18684#discussion_r1981899587


##########
server-common/src/main/java/org/apache/kafka/timeline/Snapshot.java:
##########
@@ -47,6 +48,7 @@ <T extends Delta> T getDelta(Revertable owner) {
     }
 
     void setDelta(Revertable owner, Delta delta) {
+        Objects.requireNonNull(map, "Snapshot cannot be accessed after erase 
is called.");

Review Comment:
   We should add this same check to other methods where `map` is accessed. 
   
   For example:
   ```diff
        void handleRevert() {
   +        Objects.requireNonNull(map, "Snapshot cannot be accessed after 
erase is called.");
            for (Map.Entry<Revertable, Delta> entry : map.entrySet()) {
                entry.getKey().executeRevert(epoch, entry.getValue());
            }
   ```
   



-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to