From 3ceb2efe9ec1f36dae1bdc083a01e274a01925e9 Mon Sep 17 00:00:00 2001 From: Mitya Lyubarskiy Date: Thu, 12 Mar 2020 07:14:19 -0700 Subject: [PATCH] [JavaClassName][easy] remove uneccesary whitespace strip Summary: As ngorogiannis pointed out, we never expect whitespaces in classname, so stripping makes no sense here in best case, and hides a bug under rug in worst case. Reviewed By: jvillard Differential Revision: D20417033 fbshipit-source-id: bc7449171 --- infer/src/IR/JavaClassName.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infer/src/IR/JavaClassName.ml b/infer/src/IR/JavaClassName.ml index 7de67093b..c199287cf 100644 --- a/infer/src/IR/JavaClassName.ml +++ b/infer/src/IR/JavaClassName.ml @@ -55,7 +55,7 @@ let is_int s = let strip_anonymous_suffixes_if_present classname = let rec strip_recursively classname nesting_level = match String.rsplit2 classname ~on:'$' with - | Some (outer, suffix) when is_int (String.strip suffix) -> + | Some (outer, suffix) when is_int suffix -> (* Suffix is an integer - that was an anonymous class. But it could be nested inside another anonymous class as well *) strip_recursively outer (nesting_level + 1)