[infer] fix typo in the computation of the bug hash

Summary: The Nullsafe checker integration is filtering out the pre-existing warnings based on the bug hash only. However, there was a typo in the regexp and the bug hash for methods in anonymous classes was then depending on the name (in the bytecode) of the anonymous class, i.e. depending on the `N` in  `ClassName$N.methodName()` where `N` is the occurrence of the anonymous class in `ClassName`. As a consequence, introducing a new anonymous class in a file was leading to all the reports in the subsequent anonymous classes to be marked as introduced.

Reviewed By: jberdine

Differential Revision: D10186651

fbshipit-source-id: 42e27c132
master
Jeremy Dubreil 6 years ago committed by Facebook Github Bot
parent fd29aff3a7
commit 78505af836

@ -1074,7 +1074,7 @@ module Procname = struct
| Java pname -> | Java pname ->
(* Strip autogenerated anonymous inner class numbers in order to keep the bug hash (* Strip autogenerated anonymous inner class numbers in order to keep the bug hash
invariant when introducing new annonynous classes *) invariant when introducing new annonynous classes *)
Str.global_replace (Str.regexp "$[0-9]+") "$_" Str.global_replace (Str.regexp "\\$[0-9]+") "$_"
(Java.to_string ~withclass:true pname Simple) (Java.to_string ~withclass:true pname Simple)
| ObjC_Cpp m when ObjC_Cpp.is_objc_method m -> | ObjC_Cpp m when ObjC_Cpp.is_objc_method m ->
(* In Objective C, the list of parameters is part of the method name. To prevent the bug (* In Objective C, the list of parameters is part of the method name. To prevent the bug

Loading…
Cancel
Save