diff --git a/infer/lib/python/inferlib/jwlib.py b/infer/lib/python/inferlib/jwlib.py index e3631598d..c190a2db2 100644 --- a/infer/lib/python/inferlib/jwlib.py +++ b/infer/lib/python/inferlib/jwlib.py @@ -323,9 +323,6 @@ class AnalyzerWithFrontendWrapper(analyze.AnalyzerWrapper): '-suppress_warnings_out', self.javac.suppress_warnings_out, ] - if os.path.isfile(config.MODELS_JAR): - infer_cmd += ['-models', config.MODELS_JAR] - if self.args.debug: infer_cmd.append('-debug') if self.args.analyzer == config.ANALYZER_TRACING: diff --git a/infer/src/base/Config.ml b/infer/src/base/Config.ml index 38fb04bd9..beab321c8 100644 --- a/infer/src/base/Config.ml +++ b/infer/src/base/Config.ml @@ -990,10 +990,6 @@ and ml_buckets = - 'cpp' from C++ code" ~symbols:ml_bucket_symbols -and models_file = - CLOpt.mk_path_opt ~deprecated:["models"] ~long:"models" - ~exes:CLOpt.[Analyze;Java] ~meta:"jar file" "Specify a jar file containing the Java models" - and models_mode = CLOpt.mk_bool ~deprecated:["models_mode"; "-models_mode"] ~long:"models-mode" "Mode for analyzing the models" @@ -1452,7 +1448,6 @@ and load_analysis_results = !load_results and makefile_cmdline = !makefile and merge = !merge and ml_buckets = !ml_buckets -and models_file = !models_file and models_mode = !models_mode and modified_targets = !modified_targets and monitor_prop_size = !monitor_prop_size diff --git a/infer/src/base/Config.mli b/infer/src/base/Config.mli index 190cee135..5eb16e57c 100644 --- a/infer/src/base/Config.mli +++ b/infer/src/base/Config.mli @@ -212,7 +212,6 @@ val makefile_cmdline : string val merge : bool val ml_buckets : [ `MLeak_all | `MLeak_arc | `MLeak_cf | `MLeak_cpp | `MLeak_no_arc | `MLeak_unknown ] list -val models_file : string option val models_mode : bool val modified_targets : string option val monitor_prop_size : bool diff --git a/infer/src/base/ZipLib.ml b/infer/src/base/ZipLib.ml index d6cc352ac..924e2456b 100644 --- a/infer/src/base/ZipLib.ml +++ b/infer/src/base/ZipLib.ml @@ -80,17 +80,12 @@ let zip_libraries = (* fname is a dir of specs *) zip_libs in IList.fold_left add_zip [] Config.specs_library in - let add_models file = - (mk_zip_lib true file) :: zip_libs in - match Config.models_file with - | _ when Config.checkers -> - zip_libs - | Some file -> - add_models file - | None when Sys.file_exists Config.models_jar -> - add_models Config.models_jar - | None -> - zip_libs + if Config.checkers then + zip_libs + else if Sys.file_exists Config.models_jar then + (mk_zip_lib true Config.models_jar) :: zip_libs + else + zip_libs ) (* Search path in the list of zip libraries and use a cache directory to save already diff --git a/infer/src/java/jMain.ml b/infer/src/java/jMain.ml index ff3b55b61..ad3639668 100644 --- a/infer/src/java/jMain.ml +++ b/infer/src/java/jMain.ml @@ -15,15 +15,15 @@ open Javalib_pack module L = Logging let () = - match Config.models_file with - | None when Config.models_mode -> + match Config.models_mode, Sys.file_exists Config.models_jar with + | true, false -> () - | None -> + | false, false -> failwith "Java model file is required" - | Some _ when Config.models_mode -> - failwith "Not expecting model file when analyzing the models"; - | Some file -> - JClasspath.add_models file + | true, true -> + failwith "Not expecting model file when analyzing the models" + | false, true -> + JClasspath.add_models Config.models_jar let register_perf_stats_report source_file =