From 3538caeb1b35a9c775d922b453a06c351c5b8e74 Mon Sep 17 00:00:00 2001 From: Nikos Gorogiannis Date: Wed, 26 Feb 2020 06:41:58 -0800 Subject: [PATCH] [starvation] skip getinstance methods Reviewed By: ezgicicek Differential Revision: D20116315 fbshipit-source-id: 188e1a311 --- infer/src/concurrency/StarvationModels.ml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/infer/src/concurrency/StarvationModels.ml b/infer/src/concurrency/StarvationModels.ml index e7864512e..5d773e1e0 100644 --- a/infer/src/concurrency/StarvationModels.ml +++ b/infer/src/concurrency/StarvationModels.ml @@ -21,7 +21,17 @@ let is_synchronized_library_call = false -let should_skip_analysis = MethodMatcher.of_json Config.starvation_skip_analysis +let should_skip_analysis = + let matcher = MethodMatcher.of_json Config.starvation_skip_analysis in + fun tenv pname actuals -> + match pname with + | Procname.Java java_pname + when Procname.Java.is_static java_pname + && String.equal "getInstance" (Procname.get_method pname) -> + true + | _ -> + matcher tenv pname actuals + (** magical value from https://developer.android.com/topic/performance/vitals/anr *) let android_anr_time_limit = 5.0