diff --git a/infer/src/atd/jsonbug.atd b/infer/src/atd/jsonbug.atd index 14463c8c1..2b9437426 100644 --- a/infer/src/atd/jsonbug.atd +++ b/infer/src/atd/jsonbug.atd @@ -29,7 +29,6 @@ type jsonbug = { line: int; column: int; procedure : string; - procedure_id : string; procedure_start_line : int; file : string; bug_trace : json_trace_item list; diff --git a/infer/src/backend/InferPrint.ml b/infer/src/backend/InferPrint.ml index 7a0af09bb..b09a2fa12 100644 --- a/infer/src/backend/InferPrint.ml +++ b/infer/src/backend/InferPrint.ml @@ -311,7 +311,6 @@ module JsonIssuePrinter = MakeJsonListPrinter (struct ; line= err_data.loc.Location.line ; column= err_data.loc.Location.col ; procedure - ; procedure_id= Typ.Procname.to_filename proc_name ; procedure_start_line ; file ; bug_trace= loc_trace_to_jsonbug_record err_data.loc_trace err_key.severity @@ -408,8 +407,6 @@ let pp_custom_of_report fmt report fields = Format.fprintf fmt "%s%d" (comma_separator index) issue.column | `Issue_field_procedure -> Format.fprintf fmt "%s%s" (comma_separator index) issue.procedure - | `Issue_field_procedure_id -> - Format.fprintf fmt "%s%s" (comma_separator index) issue.procedure_id | `Issue_field_procedure_start_line -> Format.fprintf fmt "%s%d" (comma_separator index) issue.procedure_start_line | `Issue_field_file -> @@ -423,8 +420,6 @@ let pp_custom_of_report fmt report fields = | `Issue_field_line_offset -> Format.fprintf fmt "%s%d" (comma_separator index) (issue.line - issue.procedure_start_line) - | `Issue_field_procedure_id_without_crc -> - Format.fprintf fmt "%s%s" (comma_separator index) (DB.strip_crc issue.procedure_id) | `Issue_field_qualifier_contains_potential_exception_note -> Format.pp_print_bool fmt (String.is_substring issue.qualifier ~substring:potential_exception_message) diff --git a/infer/src/base/Config.ml b/infer/src/base/Config.ml index e261bb215..4609a4fae 100644 --- a/infer/src/base/Config.ml +++ b/infer/src/base/Config.ml @@ -58,14 +58,12 @@ let issues_fields_symbols = ; ("line", `Issue_field_line) ; ("column", `Issue_field_column) ; ("procedure", `Issue_field_procedure) - ; ("procedure_id", `Issue_field_procedure_id) ; ("procedure_start_line", `Issue_field_procedure_start_line) ; ("file", `Issue_field_file) ; ("bug_trace", `Issue_field_bug_trace) ; ("key", `Issue_field_key) ; ("hash", `Issue_field_hash) ; ("line_offset", `Issue_field_line_offset) - ; ("procedure_id_without_crc", `Issue_field_procedure_id_without_crc) ; ( "qualifier_contains_potential_exception_note" , `Issue_field_qualifier_contains_potential_exception_note ) ] diff --git a/infer/src/base/Config.mli b/infer/src/base/Config.mli index e303d9cf5..fcd438c88 100644 --- a/infer/src/base/Config.mli +++ b/infer/src/base/Config.mli @@ -406,14 +406,12 @@ val issues_fields : | `Issue_field_line | `Issue_field_column | `Issue_field_procedure - | `Issue_field_procedure_id | `Issue_field_procedure_start_line | `Issue_field_file | `Issue_field_bug_trace | `Issue_field_key | `Issue_field_hash | `Issue_field_line_offset - | `Issue_field_procedure_id_without_crc | `Issue_field_qualifier_contains_potential_exception_note ] list diff --git a/infer/src/base/DB.ml b/infer/src/base/DB.ml index 6037a6c04..50d5982be 100644 --- a/infer/src/base/DB.ml +++ b/infer/src/base/DB.ml @@ -28,11 +28,6 @@ let append_crc_cutoff ?(key= "") ?(crc_only= false) name = if crc_only then crc_str else Printf.sprintf "%s%c%s" name_up_to_cutoff crc_token crc_str -(* Lengh of .crc part: 32 characters of digest, plus 1 character of crc_token *) -let dot_crc_len = 1 + 32 - -let strip_crc str = String.slice str 0 (-dot_crc_len) - let curr_source_file_encoding = `Enc_crc (** string encoding of a source file (including path) as a single filename *) diff --git a/infer/src/base/DB.mli b/infer/src/base/DB.mli index c93c1b5a1..2a4d9bcaa 100644 --- a/infer/src/base/DB.mli +++ b/infer/src/base/DB.mli @@ -61,9 +61,6 @@ val append_crc_cutoff : ?key:string -> ?crc_only:bool -> string -> string Use an optional key to compute the crc. Return only the crc if [crc_only] is true. *) -val strip_crc : string -> string -(** Strip any crc attached to any string generated by string_append_crc_cutoff *) - val source_file_encoding : SourceFile.t -> string (** string encoding of a source file (including path) as a single filename *) diff --git a/infer/src/unit/DifferentialTestsUtils.ml b/infer/src/unit/DifferentialTestsUtils.ml index 4e171881f..5d6081b43 100644 --- a/infer/src/unit/DifferentialTestsUtils.ml +++ b/infer/src/unit/DifferentialTestsUtils.ml @@ -9,11 +9,10 @@ open! IStd let create_fake_jsonbug ?(bug_class= "bug_class") ?(kind= "kind") ?(bug_type= "bug_type") ?(qualifier= "qualifier") ?(severity= "severity") ?(visibility= "visibility") ?(line= 1) - ?(column= 1) ?(procedure= "procedure") ?(procedure_id= "procedure_id") - ?(procedure_start_line= 1) ?(file= "file/at/a/certain/path.java") ?(bug_trace= []) - ?(node_key= "File|method|TYPE") ?(key= "1234") ?(hash= "1") ?(dotty= None) - ?(infer_source_loc= None) ?(linters_def_file= Some "file/at/certain/path.al") ?doc_url () - : Jsonbug_t.jsonbug = + ?(column= 1) ?(procedure= "procedure") ?(procedure_start_line= 1) + ?(file= "file/at/a/certain/path.java") ?(bug_trace= []) ?(node_key= "File|method|TYPE") + ?(key= "1234") ?(hash= "1") ?(dotty= None) ?(infer_source_loc= None) + ?(linters_def_file= Some "file/at/certain/path.al") ?doc_url () : Jsonbug_t.jsonbug = { bug_class ; kind ; bug_type @@ -23,7 +22,6 @@ let create_fake_jsonbug ?(bug_class= "bug_class") ?(kind= "kind") ?(bug_type= "b ; line ; column ; procedure - ; procedure_id ; procedure_start_line ; file ; bug_trace diff --git a/infer/tests/build_systems/differential_interesting_paths_filter/current.exp b/infer/tests/build_systems/differential_interesting_paths_filter/current.exp index 949d85d05..9047c8c61 100644 --- a/infer/tests/build_systems/differential_interesting_paths_filter/current.exp +++ b/infer/tests/build_systems/differential_interesting_paths_filter/current.exp @@ -1,5 +1,5 @@ -NULL_DEREFERENCE, no_bucket, src/com/example/DiffClass1.java, com.example.DiffClass1.triggerNpe():int, 1, com.example.DiffClass1.triggerNpe():int.0f35dc00a0f5d9c32cb58361b79c5a0c, com.example.DiffClass1.triggerNpe():int -RESOURCE_LEAK, no_bucket, src/com/example/DiffClass2.java, com.example.DiffClass2.openResource():void, 5, com.example.DiffClass2.openResource():void.6561ab0ad86c3847cc965b847ac80324, com.example.DiffClass2.openResource():void -NULL_DEREFERENCE, no_bucket, src/com/example/DiffClass3.java, com.example.DiffClassThree.doStuff3():int, 1, com.example.DiffClassThree.doStuff3():int.d5d2e8b4c4f1e60721b0e4cebf811191, com.example.DiffClassThree.doStuff3():int -NULL_DEREFERENCE, no_bucket, src/com/example/DiffClassUnchanged.java, com.example.DiffClassUnchanged.doWrongStuff():int, 1, com.example.DiffClassUnchanged.doWrongStuff():int.8aa1760ea64381fc9a842a0c0c3f0909, com.example.DiffClassUnchanged.doWrongStuff():int -NULL_DEREFERENCE, no_bucket, src/com/example/DiffClassUnchanged.java, com.example.DiffClassUnchanged.tellMeTheLength():int, 1, com.example.DiffClassUnchanged.tellMeTheLength():int.06e7bdb4fc272c724e2b9dfc4e5026dc, com.example.DiffClassUnchanged.tellMeTheLength():int +NULL_DEREFERENCE, no_bucket, src/com/example/DiffClass1.java, com.example.DiffClass1.triggerNpe():int, 1 +RESOURCE_LEAK, no_bucket, src/com/example/DiffClass2.java, com.example.DiffClass2.openResource():void, 5 +NULL_DEREFERENCE, no_bucket, src/com/example/DiffClass3.java, com.example.DiffClassThree.doStuff3():int, 1 +NULL_DEREFERENCE, no_bucket, src/com/example/DiffClassUnchanged.java, com.example.DiffClassUnchanged.doWrongStuff():int, 1 +NULL_DEREFERENCE, no_bucket, src/com/example/DiffClassUnchanged.java, com.example.DiffClassUnchanged.tellMeTheLength():int, 1 diff --git a/infer/tests/build_systems/differential_interesting_paths_filter/fixed.exp b/infer/tests/build_systems/differential_interesting_paths_filter/fixed.exp index a5608efd0..2917bc39a 100644 --- a/infer/tests/build_systems/differential_interesting_paths_filter/fixed.exp +++ b/infer/tests/build_systems/differential_interesting_paths_filter/fixed.exp @@ -1 +1 @@ -NULL_DEREFERENCE, no_bucket, src/com/example/DiffClass2.java, com.example.DiffClass2.doStuff():int, 1, com.example.DiffClass2.doStuff():int.0bd745e5e0ee00c272a09256adbe19d2, com.example.DiffClass2.doStuff():int +NULL_DEREFERENCE, no_bucket, src/com/example/DiffClass2.java, com.example.DiffClass2.doStuff():int, 1 diff --git a/infer/tests/build_systems/differential_interesting_paths_filter/introduced.exp b/infer/tests/build_systems/differential_interesting_paths_filter/introduced.exp index 9f14bab8b..19c8bc2f3 100644 --- a/infer/tests/build_systems/differential_interesting_paths_filter/introduced.exp +++ b/infer/tests/build_systems/differential_interesting_paths_filter/introduced.exp @@ -1,2 +1,2 @@ -NULL_DEREFERENCE, no_bucket, src/com/example/DiffClass3.java, com.example.DiffClassThree.doStuff3():int, 1, com.example.DiffClassThree.doStuff3():int.d5d2e8b4c4f1e60721b0e4cebf811191, com.example.DiffClassThree.doStuff3():int -NULL_DEREFERENCE, no_bucket, src/com/example/DiffClassUnchanged.java, com.example.DiffClassUnchanged.tellMeTheLength():int, 1, com.example.DiffClassUnchanged.tellMeTheLength():int.06e7bdb4fc272c724e2b9dfc4e5026dc, com.example.DiffClassUnchanged.tellMeTheLength():int +NULL_DEREFERENCE, no_bucket, src/com/example/DiffClass3.java, com.example.DiffClassThree.doStuff3():int, 1 +NULL_DEREFERENCE, no_bucket, src/com/example/DiffClassUnchanged.java, com.example.DiffClassUnchanged.tellMeTheLength():int, 1 diff --git a/infer/tests/build_systems/differential_interesting_paths_filter/preexisting.exp b/infer/tests/build_systems/differential_interesting_paths_filter/preexisting.exp index 8a2a16b79..d4160eca7 100644 --- a/infer/tests/build_systems/differential_interesting_paths_filter/preexisting.exp +++ b/infer/tests/build_systems/differential_interesting_paths_filter/preexisting.exp @@ -1 +1 @@ -RESOURCE_LEAK, no_bucket, src/com/example/DiffClass2.java, com.example.DiffClass2.openResource():void, 5, com.example.DiffClass2.openResource():void.6561ab0ad86c3847cc965b847ac80324, com.example.DiffClass2.openResource():void +RESOURCE_LEAK, no_bucket, src/com/example/DiffClass2.java, com.example.DiffClass2.openResource():void, 5 diff --git a/infer/tests/build_systems/differential_interesting_paths_filter/previous.exp b/infer/tests/build_systems/differential_interesting_paths_filter/previous.exp index 999eba375..1c8f814ce 100644 --- a/infer/tests/build_systems/differential_interesting_paths_filter/previous.exp +++ b/infer/tests/build_systems/differential_interesting_paths_filter/previous.exp @@ -1,4 +1,4 @@ -NULL_DEREFERENCE, no_bucket, src/com/example/DiffClass1.java, com.example.DiffClass1.triggerNpe():int, 1, com.example.DiffClass1.triggerNpe():int.0f35dc00a0f5d9c32cb58361b79c5a0c, com.example.DiffClass1.triggerNpe():int -NULL_DEREFERENCE, no_bucket, src/com/example/DiffClass2.java, com.example.DiffClass2.doStuff():int, 1, com.example.DiffClass2.doStuff():int.0bd745e5e0ee00c272a09256adbe19d2, com.example.DiffClass2.doStuff():int -RESOURCE_LEAK, no_bucket, src/com/example/DiffClass2.java, com.example.DiffClass2.openResource():void, 5, com.example.DiffClass2.openResource():void.6561ab0ad86c3847cc965b847ac80324, com.example.DiffClass2.openResource():void -NULL_DEREFERENCE, no_bucket, src/com/example/DiffClassUnchanged.java, com.example.DiffClassUnchanged.doWrongStuff():int, 1, com.example.DiffClassUnchanged.doWrongStuff():int.8aa1760ea64381fc9a842a0c0c3f0909, com.example.DiffClassUnchanged.doWrongStuff():int +NULL_DEREFERENCE, no_bucket, src/com/example/DiffClass1.java, com.example.DiffClass1.triggerNpe():int, 1 +NULL_DEREFERENCE, no_bucket, src/com/example/DiffClass2.java, com.example.DiffClass2.doStuff():int, 1 +RESOURCE_LEAK, no_bucket, src/com/example/DiffClass2.java, com.example.DiffClass2.openResource():void, 5 +NULL_DEREFERENCE, no_bucket, src/com/example/DiffClassUnchanged.java, com.example.DiffClassUnchanged.doWrongStuff():int, 1 diff --git a/infer/tests/build_systems/differential_skip_anonymous_class_renamings/introduced.exp b/infer/tests/build_systems/differential_skip_anonymous_class_renamings/introduced.exp index f7cbb6d5b..761f976f0 100644 --- a/infer/tests/build_systems/differential_skip_anonymous_class_renamings/introduced.exp +++ b/infer/tests/build_systems/differential_skip_anonymous_class_renamings/introduced.exp @@ -1 +1 @@ -NULL_DEREFERENCE, no_bucket, src/DiffExample.java, DiffExample$3$1.doSomething():void, 1, DiffExample$3$1.doSomething():void.64afb6aca478af18163141bbb8999018, DiffExample$3$1.doSomething():void +NULL_DEREFERENCE, no_bucket, src/DiffExample.java, DiffExample$3$1.doSomething():void, 1 diff --git a/infer/tests/build_systems/differential_skip_anonymous_class_renamings/preexisting.exp b/infer/tests/build_systems/differential_skip_anonymous_class_renamings/preexisting.exp index 23dc775f5..ac7bb25c2 100644 --- a/infer/tests/build_systems/differential_skip_anonymous_class_renamings/preexisting.exp +++ b/infer/tests/build_systems/differential_skip_anonymous_class_renamings/preexisting.exp @@ -1 +1 @@ -NULL_DEREFERENCE, no_bucket, src/DiffExample.java, DiffExample$4.aaa():int, 0, DiffExample$4.aaa():int.a7bd5e834e7a8fb4284c75f621544e3e, DiffExample$4.aaa():int +NULL_DEREFERENCE, no_bucket, src/DiffExample.java, DiffExample$4.aaa():int, 0 diff --git a/infer/tests/build_systems/differential_skip_duplicated_types_on_filenames/introduced.exp b/infer/tests/build_systems/differential_skip_duplicated_types_on_filenames/introduced.exp index 42def0ed3..f8d0a72b9 100644 --- a/infer/tests/build_systems/differential_skip_duplicated_types_on_filenames/introduced.exp +++ b/infer/tests/build_systems/differential_skip_duplicated_types_on_filenames/introduced.exp @@ -1,2 +1,2 @@ -RESOURCE_LEAK, no_bucket, src/DiffExample.java, DiffExample.openResource():void, 5, DiffExample.openResource():void.c57b56c0042a220d7416e229c4e61b99, DiffExample.openResource():void -NULL_DEREFERENCE, no_bucket, src/DiffExampleTwo.java, DiffExampleTwo.doSomethingTwo():void, 1, DiffExampleTwo.doSomethingTwo():void.d8149869686ac2ef26a75ac4829094a7, DiffExampleTwo.doSomethingTwo():void +RESOURCE_LEAK, no_bucket, src/DiffExample.java, DiffExample.openResource():void, 5 +NULL_DEREFERENCE, no_bucket, src/DiffExampleTwo.java, DiffExampleTwo.doSomethingTwo():void, 1 diff --git a/infer/tests/build_systems/differential_skip_duplicated_types_on_filenames/preexisting.exp b/infer/tests/build_systems/differential_skip_duplicated_types_on_filenames/preexisting.exp index abc419f39..e102722bf 100644 --- a/infer/tests/build_systems/differential_skip_duplicated_types_on_filenames/preexisting.exp +++ b/infer/tests/build_systems/differential_skip_duplicated_types_on_filenames/preexisting.exp @@ -1 +1 @@ -NULL_DEREFERENCE, no_bucket, src/DiffExample.java, DiffExample.triggerNpeRenamed():int, 1, DiffExample.triggerNpeRenamed():int.3e4070b89fdefd2c64fd437530b8dda9, DiffExample.triggerNpeRenamed():int +NULL_DEREFERENCE, no_bucket, src/DiffExample.java, DiffExample.triggerNpeRenamed():int, 1 diff --git a/infer/tests/build_systems/differential_skip_duplicated_types_on_filenames_with_renamings/preexisting.exp b/infer/tests/build_systems/differential_skip_duplicated_types_on_filenames_with_renamings/preexisting.exp index 34483b685..aa4c94a88 100644 --- a/infer/tests/build_systems/differential_skip_duplicated_types_on_filenames_with_renamings/preexisting.exp +++ b/infer/tests/build_systems/differential_skip_duplicated_types_on_filenames_with_renamings/preexisting.exp @@ -1,2 +1,2 @@ -RESOURCE_LEAK, no_bucket, src/DiffExampleRenamed.java, DiffExampleRenamed.openResource():void, 5, DiffExampleRenamed.openResource():void.715df29eeb5b62c29d4081c6dc9d407a, DiffExampleRenamed.openResource():void -NULL_DEREFERENCE, no_bucket, src/DiffExampleRenamed.java, DiffExampleRenamed.triggerNpe():int, 1, DiffExampleRenamed.triggerNpe():int.708d86c0dc5dc4e5dbbbcd38276ce86f, DiffExampleRenamed.triggerNpe():int +RESOURCE_LEAK, no_bucket, src/DiffExampleRenamed.java, DiffExampleRenamed.openResource():void, 5 +NULL_DEREFERENCE, no_bucket, src/DiffExampleRenamed.java, DiffExampleRenamed.triggerNpe():int, 1 diff --git a/infer/tests/differential.make b/infer/tests/differential.make index e85773269..2e28946ab 100644 --- a/infer/tests/differential.make +++ b/infer/tests/differential.make @@ -11,7 +11,7 @@ include $(TESTS_DIR)/base.make INFER_OUT = infer-out EXPECTED_TEST_OUTPUT = introduced.exp.test INFERPRINT_ISSUES_FIELDS = \ - "bug_type,bucket,file,procedure,line_offset,procedure_id,procedure_id_without_crc" + "bug_type,bucket,file,procedure,line_offset" CURRENT_DIR = infer-out-current PREVIOUS_DIR = infer-out-previous