You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "vlade1k (via GitHub)" <gi...@apache.org> on 2024/10/22 09:30:40 UTC

[PR] MINOR: Fix strange if statements [kafka]

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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] MINOR: Fix strange if statements [kafka]

Posted by "m1a2st (via GitHub)" <gi...@apache.org>.
m1a2st commented on PR #17574:
URL: https://github.com/apache/kafka/pull/17574#issuecomment-2429108057

   Hello @vlade1k, Thanks for this PR, but it seen as same as https://github.com/apache/kafka/pull/17540 .


-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] MINOR: Fix strange if statements [kafka]

Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 commented on PR #17574:
URL: https://github.com/apache/kafka/pull/17574#issuecomment-2429951900

   close as duplicate to #17540


-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] MINOR: Fix strange if statements [kafka]

Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 closed pull request #17574: MINOR: Fix strange if statements
URL: https://github.com/apache/kafka/pull/17574


-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] MINOR: Fix strange if statements [kafka]

Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 commented on PR #17574:
URL: https://github.com/apache/kafka/pull/17574#issuecomment-2429952854

   @vlade1k thanks for your contribution. Please feel free to ping me on your next PR


-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org