[racerd] specialized error message for races involving litho components

Reviewed By: sblackshear

Differential Revision: D6339365

fbshipit-source-id: 9f63f71
master
Peter O'Hearn 7 years ago committed by Facebook Github Bot
parent d90bc24657
commit e7d9223597

@ -1005,6 +1005,10 @@ let get_reporting_explanation_java report_kind tenv pname thread =
"@\n Reporting because current method is annotated %a or overrides an annotated method." "@\n Reporting because current method is annotated %a or overrides an annotated method."
MF.pp_monospaced "@ThreadSafe") MF.pp_monospaced "@ThreadSafe")
else else
match FbThreadSafety.get_fbthreadsafe_class_annot pname tenv with
| Some (qual, annot) ->
Some (FbThreadSafety.message_fbthreadsafe_class qual annot)
| None ->
match get_current_class_and_threadsafe_superclasses tenv pname with match get_current_class_and_threadsafe_superclasses tenv pname with
| Some (current_class, (thread_safe_class :: _ as thread_safe_annotated_classes)) -> | Some (current_class, (thread_safe_class :: _ as thread_safe_annotated_classes)) ->
Some Some
@ -1013,7 +1017,8 @@ let get_reporting_explanation_java report_kind tenv pname thread =
MF.pp_monospaced "@ThreadSafe" MF.pp_monospaced "@ThreadSafe"
else else
F.asprintf "@\n Reporting because a superclass %a is annotated %a" F.asprintf "@\n Reporting because a superclass %a is annotated %a"
(MF.wrap_monospaced Typ.Name.pp) thread_safe_class MF.pp_monospaced "@ThreadSafe" ) (MF.wrap_monospaced Typ.Name.pp) thread_safe_class MF.pp_monospaced "@ThreadSafe"
)
| _ -> | _ ->
None None
in in
@ -1714,4 +1719,3 @@ let file_analysis {Callbacks.procedures} =
else (module MayAliasQuotientedAccessListMap) ) else (module MayAliasQuotientedAccessListMap) )
class_env)) class_env))
(aggregate_by_class procedures) (aggregate_by_class procedures)

@ -12,3 +12,7 @@ open! IStd
let is_custom_init _ _ = false let is_custom_init _ _ = false
let is_logging_method _ = false let is_logging_method _ = false
let get_fbthreadsafe_class_annot _ _ = None
let message_fbthreadsafe_class _ _ = ""

@ -12,3 +12,7 @@ open! IStd
val is_custom_init : Tenv.t -> Typ.Procname.t -> bool val is_custom_init : Tenv.t -> Typ.Procname.t -> bool
val is_logging_method : Typ.Procname.t -> bool val is_logging_method : Typ.Procname.t -> bool
val get_fbthreadsafe_class_annot : Typ.Procname.t -> Tenv.t -> (string * string) option
val message_fbthreadsafe_class : string -> string -> string

Loading…
Cancel
Save