@ -9,8 +9,6 @@ open! IStd
module L = Logging
module L = Logging
open ConcurrencyModels
open ConcurrencyModels
let attrs_of_pname = Summary . OnDisk . proc_resolve_attributes
module AnnotationAliases = struct
module AnnotationAliases = struct
let of_json = function
let of_json = function
| ` List aliases ->
| ` List aliases ->
@ -185,7 +183,7 @@ let should_skip =
false
false
let has_return_annot predicate pn = Annotations . pname_has_return_annot pn ~ attrs_of_pname predicate
let has_return_annot predicate pn = Annotations . pname_has_return_annot pn predicate
let is_functional pname =
let is_functional pname =
let is_annotated_functional = has_return_annot Annotations . ia_is_functional in
let is_annotated_functional = has_return_annot Annotations . ia_is_functional in
@ -290,8 +288,8 @@ let is_box = function
completely different classes that don't necessarily run on the same thread as the confined
completely different classes that don't necessarily run on the same thread as the confined
object . * )
object . * )
let is_thread_confined_method tenv pname =
let is_thread_confined_method tenv pname =
ConcurrencyModels . find_override_or_superclass_annotated ~ attrs_of_pname
ConcurrencyModels . find_override_or_superclass_annotated Annotations . ia_is_thread_confined tenv
Annotations . ia_is_thread_confined tenv pname
pname
| > Option . is_some
| > Option . is_some
@ -329,8 +327,7 @@ let is_assumed_thread_safe item_annot =
let is_assumed_thread_safe tenv pname =
let is_assumed_thread_safe tenv pname =
ConcurrencyModels . find_override_or_superclass_annotated ~ attrs_of_pname is_assumed_thread_safe
ConcurrencyModels . find_override_or_superclass_annotated is_assumed_thread_safe tenv pname
tenv pname
| > Option . is_some
| > Option . is_some
@ -357,7 +354,7 @@ let get_current_class_and_threadsafe_superclasses tenv pname =
let is_thread_safe_method pname tenv =
let is_thread_safe_method pname tenv =
match find_override_or_superclass_annotated ~ attrs_of_pname is_thread_safe tenv pname with
match find_override_or_superclass_annotated is_thread_safe tenv pname with
| Some ( DirectlyAnnotated | Override _ ) ->
| Some ( DirectlyAnnotated | Override _ ) ->
true
true
| _ ->
| _ ->
@ -368,8 +365,7 @@ let is_marked_thread_safe pname tenv =
( (* current class not marked [@NotThreadSafe] *)
( (* current class not marked [@NotThreadSafe] *)
not
not
( PatternMatch . check_current_class_attributes Annotations . ia_is_not_thread_safe tenv pname ) )
( PatternMatch . check_current_class_attributes Annotations . ia_is_not_thread_safe tenv pname ) )
&& ConcurrencyModels . find_override_or_superclass_annotated ~ attrs_of_pname is_thread_safe tenv
&& ConcurrencyModels . find_override_or_superclass_annotated is_thread_safe tenv pname
pname
| > Option . is_some
| > Option . is_some
@ -426,8 +422,8 @@ let should_flag_interface_call tenv exps call_flags pname =
&& ( not ( is_builder_method java_pname ) )
&& ( not ( is_builder_method java_pname ) )
(* can't ask anyone to annotate interfaces in library code, and Builders should always be
(* can't ask anyone to annotate interfaces in library code, and Builders should always be
thread - safe ( would be unreasonable to ask everyone to annotate them ) * )
thread - safe ( would be unreasonable to ask everyone to annotate them ) * )
&& ConcurrencyModels . find_override_or_superclass_annotated ~ attrs_of_pname
&& ConcurrencyModels . find_override_or_superclass_annotated thread_safe_or_thread_confined tenv
thread_safe_or_thread_confined tenv pname
pname
| > Option . is_none
| > Option . is_none
&& receiver_is_not_safe exps tenv
&& receiver_is_not_safe exps tenv
&& not ( implements_threadsafe_interface java_pname tenv )
&& not ( implements_threadsafe_interface java_pname tenv )