eolivelli commented on a change in pull request #9900:
URL: https://github.com/apache/pulsar/pull/9900#discussion_r593861059



##########
File path: 
pulsar-metadata/src/main/java/org/apache/pulsar/metadata/cache/impl/MetadataCacheImpl.java
##########
@@ -166,7 +166,7 @@ private MetadataCacheImpl(MetadataStore store, 
MetadataSerde<T> serde) {
                     T newValueObj;
                     byte[] newValue;
                     try {
-                        newValueObj = modifyFunction.apply(currentValue);
+                        newValueObj = 
modifyFunction.apply(serde.deserialize(serde.serialize(currentValue)));

Review comment:
       Can we add a comment that explains that we are cloning the value?
   Adding an explicit static method cloneValue will help in understanding 
better what's going on




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

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


Reply via email to