[threadsafety] don't report on class initializers

Reviewed By: sblackshear

Differential Revision: D4032522

fbshipit-source-id: 1bb10a7
master
Peter O'Hearn 8 years ago committed by Facebook Github Bot
parent dc8ab3240e
commit 2601af5ade

@ -111,6 +111,7 @@ module ResultsTableType = Map.Make (struct
let should_analyze_proc (_,_,proc_name,proc_desc) =
not (Procname.is_constructor proc_name) &&
not (Procname.is_class_initializer proc_name) &&
Cfg.Procdesc.get_access proc_desc <> PredSymb.Private
(* creates a map from proc_envs to postconditions *)

@ -24,6 +24,9 @@ import java.lang.annotation.Target;
@ThreadSafe
public class ThreadSafeExample{
/*Included to make sure infer does not report on class initializers*/
static Class<?> A = ThreadSafeExample.class;
Integer f;
public ThreadSafeExample() {

Loading…
Cancel
Save