From 7f8ce501d0cc63770424d075aea430cadd3e60cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ezgi=20=C3=87i=C3=A7ek?= Date: Fri, 14 Feb 2020 05:44:18 -0800 Subject: [PATCH] [purity] Remove duplicated/unnecessary code Summary: clowntown Reviewed By: skcho Differential Revision: D19881696 fbshipit-source-id: a01acf7b4 --- infer/src/checkers/purityModels.ml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/infer/src/checkers/purityModels.ml b/infer/src/checkers/purityModels.ml index 569a6830a..9be81c7c1 100644 --- a/infer/src/checkers/purityModels.ml +++ b/infer/src/checkers/purityModels.ml @@ -68,14 +68,12 @@ module ProcName = struct ; +PatternMatch.implements_iterator &:: "next" <>--> modifies_first ; +PatternMatch.implements_iterator &:: "remove" <>--> modifies_first ; +PatternMatch.implements_collection &:: "size" <>--> PurityDomain.pure - ; +PatternMatch.implements_map &:: "size" <>--> PurityDomain.pure ; +PatternMatch.implements_collection &:: "add" <>--> modifies_first ; +PatternMatch.implements_collection &:: "addAll" <>--> modifies_first ; +PatternMatch.implements_collection &:: "remove" <>--> modifies_first ; +PatternMatch.implements_collection &:: "isEmpty" <>--> PurityDomain.pure ; +PatternMatch.implements_collection &:: "get" <>--> PurityDomain.pure ; +PatternMatch.implements_collection &:: "set" <>--> modifies_first - (* Unlike Set.contains, List.contains is linear *) ; +PatternMatch.implements_list &:: "contains" <>--> PurityDomain.pure ; +PatternMatch.implements_collection &:: "contains" <>--> PurityDomain.pure ; +PatternMatch.implements_enumeration &:: "hasMoreElements" <>--> PurityDomain.pure @@ -89,7 +87,6 @@ module ProcName = struct ; +PatternMatch.implements_io "PrintStream" &:: "println" <>--> PurityDomain.impure_global ; +PatternMatch.implements_io "Reader" &:: "read" <>--> PurityDomain.impure_global ; +PatternMatch.implements_io "BufferedReader" &:: "readLine" <>--> PurityDomain.impure_global - (* deserialization is often expensive *) ; +PatternMatch.implements_jackson "databind.JsonDeserializer" &:: "deserialize" <>--> PurityDomain.pure ; +PatternMatch.implements_jackson "core.JsonParser" &:: "nextToken" <>--> modifies_first @@ -110,7 +107,6 @@ module ProcName = struct ; +PatternMatch.implements_lang "Number" &:: "valueOf" <>--> PurityDomain.pure ; +PatternMatch.implements_lang "String" &:: "length" <>--> PurityDomain.pure ; +PatternMatch.implements_lang "String" &:: "charAt" <>--> PurityDomain.pure - (* substring in Java >= 1.7 has linear complexity *) ; +PatternMatch.implements_lang "String" &:: "substring" <>--> PurityDomain.pure ; +PatternMatch.implements_lang "CharSequence" &:: "charAt" <>--> PurityDomain.pure ; +PatternMatch.implements_lang "String" &:: "equals" <>--> PurityDomain.pure