[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,19 +20,24 @@ 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"
["clear"; "ensureCapacity"; "put"; "putAll"; "remove"; "removeAt"; "setValueAt"]
@ make_android_support_template "SparseArrayCompat" array_methods
@ [ {default with classname= "android.util.SparseArray"; methods= array_methods}
; { default with ; { default with
classname= "android.support.v4.util.SimpleArrayMap" classname= "java.util.List"; methods= ["add"; "addAll"; "clear"; "remove"; "set"] }
; methods= ["clear"; "ensureCapacity"; "put"; "putAll"; "remove"; "removeAt"; "setValueAt"] }
; {default with classname= "android.support.v4.util.SparseArrayCompat"; methods= array_methods}
; {default with classname= "android.util.SparseArray"; methods= array_methods}
; {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
@ -40,9 +45,7 @@ let is_java_container_write =
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"
; methods=
[ "containsKey" [ "containsKey"
; "containsValue" ; "containsValue"
; "get" ; "get"
@ -51,9 +54,9 @@ let is_java_container_read =
; "isEmpty" ; "isEmpty"
; "keyAt" ; "keyAt"
; "size" ; "size"
; "valueAt" ] } ; "valueAt" ]
; {default with classname= "android.support.v4.util.SparseArrayCompat"; methods= array_methods} @ make_android_support_template "SparseArrayCompat" array_methods
; {default with classname= "android.util.SparseArray"; methods= array_methods} @ [ {default with classname= "android.util.SparseArray"; methods= array_methods}
; { default with ; { default with
classname= "java.util.List" classname= "java.util.List"
; methods= ; methods=
@ -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