[nullsafe] Properly exclude third party methods from analysis

Summary:
Currently we exlude only if the method is based on deprecated config
packages.
Lets use the proper method, which covers both cases (config +
user-defined third party repo).

Reviewed By: artempyanykh

Differential Revision: D20946506

fbshipit-source-id: c3332667f
master
Mitya Lyubarskiy 5 years ago committed by Facebook GitHub Bot
parent 8cb7f51d5e
commit c2b512c227

@ -180,7 +180,11 @@ let find_reason_to_skip_analysis proc_name proc_desc =
match proc_name with
| Procname.Java java_pname ->
if Procname.Java.is_access_method java_pname then Some "access method"
else if Procname.Java.is_external java_pname then Some "third party method"
else if
ThirdPartyAnnotationInfo.is_third_party_proc
(ThirdPartyAnnotationGlobalRepo.get_repo ())
proc_name
then Some "third party method"
else if (Procdesc.get_attributes proc_desc).ProcAttributes.is_bridge_method then
Some "bridge method"
else None

@ -407,4 +407,3 @@ codetoanalyze/java/nullsafe-default/TrueFalseOnNull.java, codetoanalyze.java.nul
codetoanalyze/java/nullsafe-default/TrueFalseOnNull.java, codetoanalyze.java.nullsafe_default.TrueFalseOnNull$TestStaticOneParam.trueOnNullPositiveBranchIsBAD(java.lang.String):void, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [`s` is nullable and is not locally checked for null when calling `toString()`.]
codetoanalyze/java/nullsafe-default/TryWithResource.java, Linters_dummy_method, 1, ERADICATE_META_CLASS_NEEDS_IMPROVEMENT, no_bucket, INFO, [], TryWithResource, codetoanalyze.java.nullsafe_default, issues: 1, curr_mode: "Default"
codetoanalyze/java/nullsafe-default/TryWithResource.java, codetoanalyze.java.nullsafe_default.TryWithResource.FP_OK_StringWriterInTWRBlock():void, 8, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [NullPointerException will be thrown at this line! Object is `null` and is dereferenced via calling `addSuppressed(...)`: null constant at line 22.]
codetoanalyze/java/nullsafe-default/third-party-test-code/some/test/pckg/ThirdPartyTestClass.java, some.test.pckg.ThirdPartyTestClass.returnSpecifiedAsNullable():java.lang.String, 0, ERADICATE_RETURN_OVER_ANNOTATED, no_bucket, ADVICE, [Method `returnSpecifiedAsNullable()` is annotated with `@Nullable` but never returns null.]

Loading…
Cancel
Save