From 31d886bede9bb223a9f3f653c4458efcb30143e2 Mon Sep 17 00:00:00 2001 From: Jeremy Dubreil Date: Tue, 25 Oct 2016 09:09:29 -0700 Subject: [PATCH] [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 --- infer/src/base/Config.ml | 1 + infer/src/java/jFrontend.ml | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/infer/src/base/Config.ml b/infer/src/base/Config.ml index 3f72117b9..4e2536908 100644 --- a/infer/src/base/Config.ml +++ b/infer/src/base/Config.ml @@ -789,6 +789,7 @@ and debug_exceptions = and 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 \ translated. No sources needed." diff --git a/infer/src/java/jFrontend.ml b/infer/src/java/jFrontend.ml index 73308f4ad..6d04d6da9 100644 --- a/infer/src/java/jFrontend.ml +++ b/infer/src/java/jFrontend.ml @@ -148,7 +148,8 @@ let is_classname_cached cn = in this case translates it. In standard mode, all methods are translated *) let create_icfg source_file linereader program icfg cn node = 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 = (* each procedure has different scope: start names from id 0 *) Ident.NameGenerator.reset ();