[racerd] androidx models

Reviewed By: jeremydubreil

Differential Revision: D14562596

fbshipit-source-id: b0c13ba72
master
Nikos Gorogiannis 6 years ago committed by Facebook Github Bot
parent c5224737c3
commit 582609b558

@ -20,68 +20,71 @@ end
type container_access = ContainerRead | ContainerWrite type container_access = ContainerRead | ContainerWrite
let make_android_support_template suffix methods =
let open MethodMatcher in
[ {default with classname= "android.support.v4.util." ^ suffix; methods}
; {default with classname= "androidx.core.util." ^ suffix; methods} ]
let is_java_container_write = let is_java_container_write =
let open MethodMatcher in let open MethodMatcher in
let array_methods = let array_methods =
["append"; "clear"; "delete"; "put"; "remove"; "removeAt"; "removeAtRange"; "setValueAt"] ["append"; "clear"; "delete"; "put"; "remove"; "removeAt"; "removeAtRange"; "setValueAt"]
in in
[ { default with make_android_support_template "Pools$SimplePool" ["acquire"; "release"]
classname= "android.support.v4.util.Pools$SimplePool"; methods= ["acquire"; "release"] } @ make_android_support_template "SimpleArrayMap"
; { default with ["clear"; "ensureCapacity"; "put"; "putAll"; "remove"; "removeAt"; "setValueAt"]
classname= "android.support.v4.util.SimpleArrayMap" @ make_android_support_template "SparseArrayCompat" array_methods
; methods= ["clear"; "ensureCapacity"; "put"; "putAll"; "remove"; "removeAt"; "setValueAt"] } @ [ {default with classname= "android.util.SparseArray"; methods= array_methods}
; {default with classname= "android.support.v4.util.SparseArrayCompat"; methods= array_methods} ; { default with
; {default with classname= "android.util.SparseArray"; methods= array_methods} classname= "java.util.List"; methods= ["add"; "addAll"; "clear"; "remove"; "set"] }
; {default with classname= "java.util.List"; methods= ["add"; "addAll"; "clear"; "remove"; "set"]} ; {default with classname= "java.util.Map"; methods= ["clear"; "put"; "putAll"; "remove"]} ]
; {default with classname= "java.util.Map"; methods= ["clear"; "put"; "putAll"; "remove"]} ]
|> of_records |> of_records
let is_java_container_read = let is_java_container_read =
let open MethodMatcher in let open MethodMatcher in
let array_methods = ["clone"; "get"; "indexOfKey"; "indexOfValue"; "keyAt"; "size"; "valueAt"] in let array_methods = ["clone"; "get"; "indexOfKey"; "indexOfValue"; "keyAt"; "size"; "valueAt"] in
[ { default with make_android_support_template "SimpleArrayMap"
classname= "android.support.v4.util.SimpleArrayMap" [ "containsKey"
; methods= ; "containsValue"
[ "containsKey" ; "get"
; "containsValue" ; "hashCode"
; "get" ; "indexOfKey"
; "hashCode" ; "isEmpty"
; "indexOfKey" ; "keyAt"
; "isEmpty" ; "size"
; "keyAt" ; "valueAt" ]
; "size" @ make_android_support_template "SparseArrayCompat" array_methods
; "valueAt" ] } @ [ {default with classname= "android.util.SparseArray"; methods= array_methods}
; {default with classname= "android.support.v4.util.SparseArrayCompat"; methods= array_methods} ; { default with
; {default with classname= "android.util.SparseArray"; methods= array_methods} classname= "java.util.List"
; { default with ; methods=
classname= "java.util.List" [ "contains"
; methods= ; "containsAll"
[ "contains" ; "equals"
; "containsAll" ; "get"
; "equals" ; "hashCode"
; "get" ; "indexOf"
; "hashCode" ; "isEmpty"
; "indexOf" ; "iterator"
; "isEmpty" ; "lastIndexOf"
; "iterator" ; "listIterator"
; "lastIndexOf" ; "size"
; "listIterator" ; "toArray" ] }
; "size" ; { default with
; "toArray" ] } classname= "java.util.Map"
; { default with ; methods=
classname= "java.util.Map" [ "containsKey"
; methods= ; "containsValue"
[ "containsKey" ; "entrySet"
; "containsValue" ; "equals"
; "entrySet" ; "get"
; "equals" ; "hashCode"
; "get" ; "isEmpty"
; "hashCode" ; "keySet"
; "isEmpty" ; "size"
; "keySet" ; "values" ] } ]
; "size"
; "values" ] } ]
|> of_records |> of_records
@ -219,7 +222,10 @@ let acquires_ownership pname tenv =
true true
| ( ( "android.support.v4.util.Pools$Pool" | ( ( "android.support.v4.util.Pools$Pool"
| "android.support.v4.util.Pools$SimplePool" | "android.support.v4.util.Pools$SimplePool"
| "android.support.v4.util.Pools$SynchronizedPool" ) | "android.support.v4.util.Pools$SynchronizedPool"
| "androidx.core.util.Pools$Pool"
| "androidx.core.util.Pools$SimplePool"
| "androidx.core.util.Pools$SynchronizedPool" )
, "acquire" ) -> , "acquire" ) ->
(* a pool should own all of its objects *) (* a pool should own all of its objects *)
true true
@ -412,7 +418,8 @@ let is_synchronized_container callee_pname ((_, (base_typ : Typ.t)), accesses) t
match Typ.Name.name tn with match Typ.Name.name tn with
| "java.util.concurrent.ConcurrentMap" | "java.util.concurrent.ConcurrentMap"
| "java.util.concurrent.CopyOnWriteArrayList" | "java.util.concurrent.CopyOnWriteArrayList"
| "android.support.v4.util.Pools$SynchronizedPool" -> | "android.support.v4.util.Pools$SynchronizedPool"
| "androidx.core.util.Pools$SynchronizedPool" ->
true true
| _ -> | _ ->
false false

Loading…
Cancel
Save