[infer][java] Skip the translation of modeled methods earlier

Summary: Seems more natural to check this at this level

Reviewed By: sblackshear

Differential Revision: D4137569

fbshipit-source-id: 283e094
master
Jeremy Dubreil 8 years ago committed by Facebook Github Bot
parent d5e7ee0d82
commit 2e16920f5a

@ -147,13 +147,19 @@ let create_icfg source_file linereader program icfg cn node =
cache_classname cn;
let translate m =
let proc_name = JTransType.translate_method_name m in
if JClasspath.is_model proc_name then
(* do not translate the method if there is a model for it *)
L.out_debug "Skipping method with a model: %s@." (Procname.to_string proc_name)
else
begin
(* each procedure has different scope: start names from id 0 *)
Ident.NameGenerator.reset ();
match m with
| Javalib.ConcreteMethod cm ->
add_cmethod source_file program linereader icfg cm proc_name
| Javalib.AbstractMethod am ->
add_amethod source_file program linereader icfg am proc_name in
add_amethod source_file program linereader icfg am proc_name
end in
Javalib.m_iter translate node

@ -236,13 +236,6 @@ let create_procdesc source_file program linereader icfg m : Cfg.Procdesc.t optio
let tenv = icfg.JContext.tenv in
let cn, ms = JBasics.cms_split (Javalib.get_class_method_signature m) in
let proc_name = JTransType.translate_method_name m in
if JClasspath.is_model proc_name then
begin
(* do not translate the method if there is a model for it *)
L.out_debug "Skipping method with a model: %s@." (Procname.to_string proc_name);
None
end
else
let trans_access = function
| `Default -> PredSymb.Default
| `Public -> PredSymb.Public

Loading…
Cancel
Save