raducotescu commented on pull request #21:
URL: 
https://github.com/apache/sling-org-apache-sling-models-impl/pull/21#issuecomment-712740266


   SonarCube is right and you have the rule's explanation: "The story is very 
similar for synchronizing on parameters; two different threads running the 
method in parallel could pass two different object instances in to the method 
as parameters, completely undermining the synchronization."
   
   Usually you should synchronize on objects you control. For the case where 
the `adaptable` is a request you don't need to do any synchronization. For the 
other case I think it's sufficient to use `adapterCache.computeIfAbsent`.


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