vlade1k opened a new pull request, #17574:
URL: https://github.com/apache/kafka/pull/17574

   I have discovered two strange if statements, so I have committed a fix.
   
   I would like to suggest you check the 'handleDeleteTopicsUsingNames' method 
in the 'MockAdminClient' class. At the moment, on line 584, an item is deleted 
from the collection iterated over 'Iterator'. In the same line, a UUID object 
is deleted from the 'topicIds' collection when it handles the 'String' objects.
   
   In the 'LogicalKeyValueSegment' class, the 'prefixKeyFormatter' object is 
executed through both synchronized and unsynchronized methods. The code seems 
suspicious.
   
   In the 'Sensor' class, the 'metrics' collection is executed through both 
synchronized and unsynchronized methods. I would recommend paying attention to 
this code too.
   
   The PVS Studio static analyzer has detected these suspicious code fragments. 
They were described in the following article: 
https://pvs-studio.com/en/blog/posts/java/1171/.
   
   The fixes of potential NPEs from the article have already been committed: 
https://github.com/apache/kafka/pull/17541.
   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [ ] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)
   


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