[ConfigImpact] Loosely compare ObjC method names

Summary:
This diff compares ObjC method names loosely when checking whether it is in the config impact data
file or not.  This is to cover the cases where method parameters changed.

Reviewed By: jvillard

Differential Revision: D28259169

fbshipit-source-id: e6070df9c
master
Sungkeun Cho 4 years ago committed by Facebook GitHub Bot
parent 1bd741b070
commit 64406137e9

@ -26,6 +26,11 @@ let read_file_config_data fname =
ConfigProcnameSet.add itm acc ) ConfigProcnameSet.add itm acc )
let is_similar_method_name =
let cut_objc_parameters name = List.hd_exn (String.split name ~on:':') in
fun name1 name2 -> String.equal (cut_objc_parameters name1) (cut_objc_parameters name2)
let is_in_config_data_file = let is_in_config_data_file =
let config_data = let config_data =
Option.value_map Config.config_impact_data_file ~default:ConfigProcnameSet.empty Option.value_map Config.config_impact_data_file ~default:ConfigProcnameSet.empty
@ -34,7 +39,7 @@ let is_in_config_data_file =
fun proc_name -> fun proc_name ->
ConfigProcnameSet.exists ConfigProcnameSet.exists
(fun {method_name; class_name} -> (fun {method_name; class_name} ->
String.equal method_name (Procname.get_method proc_name) is_similar_method_name method_name (Procname.get_method proc_name)
&& String.equal class_name (Procname.get_class_name proc_name |> Option.value ~default:"") && String.equal class_name (Procname.get_class_name proc_name |> Option.value ~default:"")
) )
config_data config_data

Loading…
Cancel
Save