[infer][java] only cache the classname of translated classes when running Infer with the --dependencies option

Summary: For some reason, the frontend was always caching the name of the translated classes even when the `--dependencies` was not passed

Reviewed By: jberdine

Differential Revision: D4074225

fbshipit-source-id: 8aa2c79
master
Jeremy Dubreil 8 years ago committed by Facebook Github Bot
parent 355ab92130
commit 31d886bede

@ -789,6 +789,7 @@ and debug_exceptions =
and dependencies = and dependencies =
CLOpt.mk_bool ~deprecated:["dependencies"] ~long:"dependencies" CLOpt.mk_bool ~deprecated:["dependencies"] ~long:"dependencies"
~exes:CLOpt.[Java]
"Translate all the dependencies during the capture. The classes in the given jar file will be \ "Translate all the dependencies during the capture. The classes in the given jar file will be \
translated. No sources needed." translated. No sources needed."

@ -148,7 +148,8 @@ let is_classname_cached cn =
in this case translates it. In standard mode, all methods are translated *) in this case translates it. In standard mode, all methods are translated *)
let create_icfg source_file linereader program icfg cn node = let create_icfg source_file linereader program icfg cn node =
JUtils.log "\tclassname: %s@." (JBasics.cn_name cn); JUtils.log "\tclassname: %s@." (JBasics.cn_name cn);
cache_classname cn; if Config.dependency_mode && not (is_classname_cached cn) then
cache_classname cn;
let translate m = let translate m =
(* each procedure has different scope: start names from id 0 *) (* each procedure has different scope: start names from id 0 *)
Ident.NameGenerator.reset (); Ident.NameGenerator.reset ();

Loading…
Cancel
Save