diff --git a/infer/src/java/jConfig.ml b/infer/src/java/jConfig.ml index 26380c04f..e5b05f6e9 100644 --- a/infer/src/java/jConfig.ml +++ b/infer/src/java/jConfig.ml @@ -13,19 +13,17 @@ open! Utils open Javalib_pack (** {2 Class names and types} *) -let infer_builtins_cl = JBasics.make_cn "com.facebook.infer.models.InferBuiltins" +let builtins_package = "com.facebook.infer.models" -let infer_array_cl = "com.facebook.infer.models.InferArray" +let infer_builtins_cl = builtins_package ^ ".InferBuiltins" -let infer_undefined_cl = "com.facebook.infer.models.InferUndefined" +let infer_array_cl = builtins_package ^ ".InferArray" -let infer_object_cl = "com.facebook.infer.models.InferObject" +let infer_undefined_cl = builtins_package ^ ".InferUndefined" -let object_cl = "java.lang.Object" +let object_cl = JBasics.cn_name JBasics.java_lang_object -let java_lang_object_classname = Mangled.from_string object_cl - -let obj_type = (JBasics.TObject (JBasics.TClass (JBasics.make_cn object_cl))) +let obj_type = (JBasics.TObject (JBasics.TClass JBasics.java_lang_object)) let bool_type = JBasics.TBasic `Bool diff --git a/infer/src/java/jTrans.ml b/infer/src/java/jTrans.ml index 9123e679f..a39562117 100644 --- a/infer/src/java/jTrans.ml +++ b/infer/src/java/jTrans.ml @@ -86,7 +86,7 @@ let get_undefined_method_call ovt = if JBasics.cn_name cn = JConfig.string_cl then "string_undefined" else - if JBasics.cn_name cn = JConfig.object_cl then + if JBasics.cn_equal cn JBasics.java_lang_object then "object_undefined" else assert false end in @@ -596,7 +596,7 @@ let method_invocation expr_list in let callee_procname = let proc = Procname.from_string_c_fun (JBasics.ms_name ms) in - if JBasics.cn_equal cn' JConfig.infer_builtins_cl && + if JBasics.cn_equal cn' (JBasics.make_cn JConfig.infer_builtins_cl) && Builtin.is_registered proc then proc else Procname.Java (JTransType.get_method_procname cn' ms method_kind) in diff --git a/infer/src/java/jTransType.ml b/infer/src/java/jTransType.ml index ac5af2971..c6f6cf573 100644 --- a/infer/src/java/jTransType.ml +++ b/infer/src/java/jTransType.ml @@ -89,10 +89,10 @@ let rec create_array_type typ dim = let extract_cn_no_obj typ = match typ with | Typ.Tptr (Tstruct (TN_csu (Class _, _) as name), Pk_pointer) -> - let class_name = Typename.name name in - if class_name = JConfig.object_cl then None + let class_name = JBasics.make_cn (Typename.name name) in + if JBasics.cn_equal class_name JBasics.java_lang_object then None else - let jbir_class_name = (JBasics.make_cn class_name) in + let jbir_class_name = class_name in Some jbir_class_name | _ -> None @@ -423,7 +423,7 @@ let rec expr_type (context : JContext.t) expr = Object instead. *) let return_type program tenv ms meth_kind = if meth_kind = JContext.Init then - get_class_type program tenv (JBasics.make_cn JConfig.object_cl) + get_class_type program tenv JBasics.java_lang_object else match JBasics.ms_rtype ms with | None -> Typ.Tvoid