From 78505af836cced2530d6c26c89eff26b5347d866 Mon Sep 17 00:00:00 2001 From: Jeremy Dubreil Date: Thu, 4 Oct 2018 08:01:22 -0700 Subject: [PATCH] [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 --- infer/src/IR/Typ.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infer/src/IR/Typ.ml b/infer/src/IR/Typ.ml index dd51aa728..fa888d197 100644 --- a/infer/src/IR/Typ.ml +++ b/infer/src/IR/Typ.ml @@ -1074,7 +1074,7 @@ module Procname = struct | Java pname -> (* Strip autogenerated anonymous inner class numbers in order to keep the bug hash 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) | 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