apoorvmittal10 commented on code in PR #16513: URL: https://github.com/apache/kafka/pull/16513#discussion_r1663843416
########## server/src/main/java/org/apache/kafka/server/share/ShareSessionCache.java: ########## @@ -41,10 +41,10 @@ public class ShareSessionCache { private long numPartitions = 0; // A map of session key to ShareSession. - private Map<ShareSessionKey, ShareSession> sessions = new HashMap<>(); + private final Map<ShareSessionKey, ShareSession> sessions = new HashMap<>(); // Maps last used times to sessions. - private TreeMap<LastUsedKey, ShareSession> lastUsed = new TreeMap<>(); + private final TreeMap<LastUsedKey, ShareSession> lastUsed = new TreeMap<>(); // Visible for testing public synchronized TreeMap<LastUsedKey, ShareSession> lastUsed() { Review Comment: Yeah, that's true this is bit odd and I have removed the method from the class itself. I don't see any usage of this method yet and if required by tests in future then we should send a copy of tree map instead the map itself. -- 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