facebook / infer

A static analyzer for Java, C, C++, and Objective-C
http://fbinfer.com/
MIT License
14.83k stars 2k forks source link

RacerD should understand JCIP annotations like NotThreadSafe #1724

Closed dsmiley closed 1 year ago

dsmiley commented 1 year ago

I am using RacerD indirectly via Sonatype Lift and see THREAD_SAFETY_VIOLATION reported against my project. I want to add Java annotations to help RacerD help us and to better communicate threading/concurrency expectations to readers of our code. I see RacerD has its own/special annotations like ThreadConfined. I request that RacerD be adapted to recognize JCIP annotations like NotThreadSafe which is equivalent to ThreadConfined.

ngorogiannis commented 1 year ago

NotThreadSafe is supported: https://fbinfer.com/docs/all-issue-types#thread-safety-conditions-checked-before-reporting

dsmiley commented 1 year ago

Great! This wasn't obvious in the docs! I think https://fbinfer.com/docs/1.0.0/checker-racerd#annotations-to-help-racerd-understand-your-code (which also shows annotations prominently in the sidebar) should show JCIP annotations.