ZiyaoWei opened a new issue #14821:
URL: https://github.com/apache/pulsar/issues/14821


   **Describe the bug**
   
   
   Currently TableViewImpl methods that access the underlying map, e.g., 
TableViewImpl::KeySet() 
(https://github.com/apache/pulsar/blob/master/pulsar-client/src/main/java/org/apache/pulsar/client/impl/TableViewImpl.java#L141)
 returns views of the underlying map, which means users could modify the 
returned value and accidentally change the internal state of TableViewImpl.
   
   **To Reproduce**
   
   If we remove a key from the KeySet in `TableViewTest::testTableView`, the 
test would fail.
   
   **Expected behavior**
   
   Modifying the returned key set/values/etc. shouldn't change the internal 
state of the TableViewImpl.
   
   **Additional context**
   
   We should probably fix it before people start relying on this behavior :-)


-- 
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]


Reply via email to