lhotari commented on code in PR #19160:
URL: https://github.com/apache/pulsar/pull/19160#discussion_r1068647149


##########
pulsar-broker-common/src/main/java/org/apache/pulsar/broker/resources/LocalPoliciesResources.java:
##########
@@ -66,7 +66,7 @@ public 
CompletableFuture<Optional<CacheGetResult<LocalPolicies>>> getLocalPolici
     public CompletableFuture<Void> setLocalPoliciesWithVersion(NamespaceName 
ns, LocalPolicies policies,
                                                                Optional<Long> 
version) {
         try {
-            byte[] content = 
ObjectMapperFactory.getThreadLocal().writeValueAsBytes(policies);
+            byte[] content = 
ObjectMapperFactory.getMapper().writer().writeValueAsBytes(policies);

Review Comment:
   I was thinking of that, but the challenge is that there's also the Yaml 
versions and the ObjectMapper configured to filter null fields. That would 
result in a lot of similar methods. It's a tradeoff. 
   Leaving ObjectMapperFactory as-is and creating a completely new class would 
be another option. I'd suggest that it's left as another PR to continue 
refactoring. 



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