From d4e46239b9a64010e8ae5517f96bfbc53f2ba018 Mon Sep 17 00:00:00 2001 From: Mitya Lyubarskiy Date: Thu, 10 Sep 2020 09:56:12 -0700 Subject: [PATCH] [nullsafe][EASY] Whitelist static fields from `java.nio.charset.StandardCharsets` Summary: Since we don't yet support `.sig` files for fields, hardcoding this in Ocaml for now. Reviewed By: jvillard Differential Revision: D23627390 fbshipit-source-id: 8df78068d --- infer/src/nullsafe/modelTables.ml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/infer/src/nullsafe/modelTables.ml b/infer/src/nullsafe/modelTables.ml index 991edc02c..e4a347435 100644 --- a/infer/src/nullsafe/modelTables.ml +++ b/infer/src/nullsafe/modelTables.ml @@ -714,7 +714,16 @@ let nonnull_alternatives_table = mk_table method_descr_to_alternative -let field_nullability = [("java.lang.Boolean.TRUE", o); ("java.lang.Boolean.FALSE", o)] +let field_nullability = + [ ("java.lang.Boolean.TRUE", o) + ; ("java.lang.Boolean.FALSE", o) + ; ("java.nio.charset.StandardCharsets.ISO_8859_1", o) + ; ("java.nio.charset.StandardCharsets.US_ASCII", o) + ; ("java.nio.charset.StandardCharsets.UTF_16", o) + ; ("java.nio.charset.StandardCharsets.UTF_16BE", o) + ; ("java.nio.charset.StandardCharsets.UTF_16LE", o) + ; ("java.nio.charset.StandardCharsets.UTF_8", o) ] + let field_nullability_table = let table = Hashtbl.create 1 in