infer icon indicating copy to clipboard operation
infer copied to clipboard

INTERFACE_NOT_THREAD_SAFE should not apply to dependencies

Open dsmiley opened this issue 2 years ago • 4 comments

I have a Java class annotated with @ThreadSafe and it uses the pervasive SLF4j Logger for logging. Infer/RacerD complains that Logger should be declared ThreadSafe -- INTERFACE_NOT_THREAD_SAFE :-)
Obviously it's not within my power to do that; it's in a dependency of my project.

dsmiley avatar Feb 15 '23 05:02 dsmiley

You may find the --external-java-packages option useful, it should suppress reports in external packages.

ngorogiannis avatar Feb 15 '23 09:02 ngorogiannis

I tried to use external-java-packages vis-a-vis Sonatype Lift (whom I am also in contact with for support). But the results (of Lift invoking Infer) show that ThreadSafe annotated classes which use SLF4J (despite me trying to tell RacerD to ignore SLF4J) are still reporting the problem. Does anything jump out at you as a problem? Well never mind; I think configuring package-by-package is a losing strategy anyway. Realistically I'm going to have to just configure Lift to ignore all INTERFACE_NOT_THREADSAFE. I find RacerD's default mode here with respect to this issue type very surprising; it seems to not recognize what an "external" package is by itself (which it should be able to do based source file availability of course). A TODO for a better RacerD.

dsmiley avatar Mar 07 '23 04:03 dsmiley

If you can produce a minimal repro I'd be happy to look into it.

ngorogiannis avatar Mar 07 '23 09:03 ngorogiannis

Good.

SolomonSun2010 avatar May 26 '23 10:05 SolomonSun2010