[nullsafe] Respect third party repo when identifying whether to hide bad param calls

Summary:
We will migrate to the new representation in the future, but for now
let's keep both active.

Reviewed By: artempyanykh

Differential Revision: D18657955

fbshipit-source-id: 9deb03f1f
master
Mitya Lyubarskiy 5 years ago committed by Facebook Github Bot
parent bd426954a3
commit 473147eb40

@ -408,20 +408,28 @@ type resolved_param =
; actual: Exp.t * InferredNullability.t ; actual: Exp.t * InferredNullability.t
; is_formal_propagates_nullable: bool } ; is_formal_propagates_nullable: bool }
let is_third_party_via_sig_files proc_name =
Option.is_some
(ThirdPartyAnnotationInfo.lookup_related_sig_file_by_package
(ThirdPartyAnnotationGlobalRepo.get_repo ())
proc_name)
let is_marked_third_party_in_config proc_name =
match proc_name with
| Typ.Procname.Java java_pname ->
(* TODO: migrate to the new way of checking for third party: use
signatures repository instead of looking it up in config params.
*)
Typ.Procname.Java.is_external java_pname
| _ ->
false
(* if this method belongs to a third party code, but is not modelled neigher internally nor externally *) (* if this method belongs to a third party code, but is not modelled neigher internally nor externally *)
let is_third_party_without_model proc_name = let is_third_party_without_model proc_name =
let is_third_party = let is_third_party =
match proc_name with is_third_party_via_sig_files proc_name || is_marked_third_party_in_config proc_name
| Typ.Procname.Java java_pname ->
(* TODO: migrate to the new way of checking for third party: use
signatures repository instead of looking it up in config params.
*)
Typ.Procname.Java.is_external java_pname
| _ ->
false
(* TODO: propagate the knowledge if it is a third-party or not in the annotated signature instead
of calculating it every time from scratch.
*)
in in
is_third_party is_third_party
&& (not (Models.is_modelled_for_nullability_as_internal proc_name)) && (not (Models.is_modelled_for_nullability_as_internal proc_name))

Loading…
Cancel
Save