[infer][ondemand] no longer use deprecated reporting function for the suggest nullable checker

Summary:
:
No longer use deprecated reporting function for the suggest nullable checker

Depends on D5205009

Reviewed By: grievejia

Differential Revision: D5205843

fbshipit-source-id: f6dd059
master
Jeremy Dubreil 8 years ago committed by Facebook Github Bot
parent cddd1b4ca2
commit c51458f7a8

@ -164,10 +164,9 @@ let pretty_field_name proc_data field_name =
(* This format is subject to change once this checker gets to run on C/Cpp/ObjC *)
Fieldname.to_string field_name
let checker callback =
let checker ({ Callbacks.summary } as callback) =
let report astate (proc_data : extras ProcData.t) =
let report_access_path ap udchain =
let pname = Procdesc.get_proc_name proc_data.pdesc in
let issue_kind = Localise.to_issue_id Localise.field_should_be_nullable in
match AccessPath.Raw.get_field_and_annotation ap proc_data.tenv with
| Some (field_name, _) ->
@ -180,9 +179,9 @@ let checker callback =
begin
match make_error_trace astate ap udchain with
| Some (loc, ltr) ->
Reporting.log_warning_deprecated pname ~loc ~ltr exn
Reporting.log_warning summary ~loc ~ltr exn
| None ->
Reporting.log_warning_deprecated pname exn
Reporting.log_warning summary exn
end
| _ -> ()
in

@ -28,10 +28,10 @@ public class FragmentDoesNotRetainViewExample extends Fragment {
}
@Nullable View mView1;
@Nullable View mView2;
@Nullable ViewGroup mViewSubclass;
@Nullable CustomView mCustomView;
View mView1;
View mView2;
ViewGroup mViewSubclass;
CustomView mCustomView;
boolean b;

@ -26,6 +26,10 @@ codetoanalyze/java/checkers/ExpensiveInheritanceExample.java, void ExpensiveInhe
codetoanalyze/java/checkers/ExpensiveInheritanceExample.java, void ExpensiveInheritanceExample.reportsBecauseFooIsExpensiveInA(A), 1, CHECKERS_CALLS_EXPENSIVE_METHOD, []
codetoanalyze/java/checkers/ExpensiveInterfaceExample.java, void ExpensiveInterfaceExample$ImplementsInterface.m1(), 1, CHECKERS_CALLS_EXPENSIVE_METHOD, []
codetoanalyze/java/checkers/ExpensiveSubtypingExample.java, void ExpensiveSubtypingExample.m3(), 0, CHECKERS_EXPENSIVE_OVERRIDES_UNANNOTATED, [return from a call to void ExpensiveSubtypingExample.m3()]
codetoanalyze/java/checkers/FragmentDoesNotRetainViewExample.java, void FragmentDoesNotRetainViewExample.onDestroyView(), 1, FIELD_SHOULD_BE_NULLABLE, [Field mView1 is assigned null here]
codetoanalyze/java/checkers/FragmentDoesNotRetainViewExample.java, void FragmentDoesNotRetainViewExample.onDestroyView(), 3, FIELD_SHOULD_BE_NULLABLE, [Field mView2 is assigned null here]
codetoanalyze/java/checkers/FragmentDoesNotRetainViewExample.java, void FragmentDoesNotRetainViewExample.onDestroyView(), 5, FIELD_SHOULD_BE_NULLABLE, [Field mCustomView is assigned null here]
codetoanalyze/java/checkers/FragmentDoesNotRetainViewExample.java, void FragmentDoesNotRetainViewExample.onDestroyView(), 6, FIELD_SHOULD_BE_NULLABLE, [Field mViewSubclass is assigned null here]
codetoanalyze/java/checkers/FragmentRetainsViewExample.java, void FragmentRetainsViewExample.onDestroyView(), 0, CHECKERS_FRAGMENT_RETAINS_VIEW, [return from a call to void FragmentRetainsViewExample.onDestroyView()]
codetoanalyze/java/checkers/FragmentRetainsViewExample.java, void FragmentRetainsViewExample.onDestroyView(), 0, CHECKERS_FRAGMENT_RETAINS_VIEW, [return from a call to void FragmentRetainsViewExample.onDestroyView()]
codetoanalyze/java/checkers/FragmentRetainsViewExample.java, void FragmentRetainsViewExample.onDestroyView(), 0, CHECKERS_FRAGMENT_RETAINS_VIEW, [return from a call to void FragmentRetainsViewExample.onDestroyView()]

Loading…
Cancel
Save