From 14c41278e6ee2a97e42bdfcb9b2f590afbc20e62 Mon Sep 17 00:00:00 2001 From: Sam Blackshear Date: Wed, 22 Jul 2015 21:01:32 -0600 Subject: [PATCH] [Infer] Better error message for warnings based on @Nullable Summary: Make confusing error message in complicated case where @Nullable-annotated object flows to an object without an annotation a bit clearer. --- infer/src/backend/localise.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/infer/src/backend/localise.ml b/infer/src/backend/localise.ml index 37606541a..67f791a10 100644 --- a/infer/src/backend/localise.ml +++ b/infer/src/backend/localise.ml @@ -403,8 +403,8 @@ let dereference_string deref_str value_str access_opt loc = let problem_str = match Tags.get !tags Tags.nullable_src with | Some nullable_src -> - if nullable_src = value_str then "is annotated with @Nullable and is dereferenced" - else "may hold @Nullable-annotated object " ^ nullable_src ^ " and is dereferenced" + if nullable_src = value_str then "is annotated with @Nullable and is dereferenced without a null check" + else "is indirectly marked @Nullable (source: " ^ nullable_src ^ ") and is dereferenced without a null check" | None -> deref_str.problem_str in [(problem_str ^ " " ^ at_line tags loc)] in value_desc:: access_desc @ problem_desc, None, !tags