From f47d4ed28519bf6efe2cda46f127ab9e78a00d58 Mon Sep 17 00:00:00 2001 From: David Pichardie Date: Wed, 17 Jul 2019 08:45:06 -0700 Subject: [PATCH] Compatibility with javalib 3.1 release Summary: This javalib release gives compatibility with java 9 modules. It should also remove some Infer warnings (when a class has no superclass) JFile.sep is now a char Reviewed By: jvillard Differential Revision: D16220583 fbshipit-source-id: 5d05afde0 --- infer/src/java/jClasspath.ml | 9 +++------ opam | 2 +- opam.locked | 3 +-- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/infer/src/java/jClasspath.ml b/infer/src/java/jClasspath.ml index 12f896c57..ad2fd5cc3 100644 --- a/infer/src/java/jClasspath.ml +++ b/infer/src/java/jClasspath.ml @@ -40,11 +40,7 @@ let add_models jar_filename = let is_model procname = String.Set.mem !models_specs_filenames (Typ.Procname.to_filename procname) -let split_classpath = - assert (Int.( = ) (String.length JFile.sep) 1) ; - let char_sep = JFile.sep.[0] in - fun cp -> String.split ~on:char_sep cp - +let split_classpath = String.split ~on:JFile.sep let classpath_of_paths paths = let of_path path = @@ -56,7 +52,8 @@ let classpath_of_paths paths = L.debug Capture Medium "Path %s not found" full_path ; None in - List.filter_map paths ~f:of_path |> String.concat ~sep:JFile.sep + let string_sep = Char.to_string JFile.sep in + List.filter_map paths ~f:of_path |> String.concat ~sep:string_sep type file_entry = Singleton of SourceFile.t | Duplicate of (string * SourceFile.t) list diff --git a/opam b/opam index 190583537..babfcd970 100644 --- a/opam +++ b/opam @@ -34,7 +34,7 @@ depends: [ "ctypes" {>="0.9.2"} "dune" {build & >="1.0"} "elina" {>="1.1"} - "javalib" {="3.0"} + "javalib" {>="3.1"} "mtime" "ocaml" {>="4.06.0"} "ocamlfind" {build} diff --git a/opam.locked b/opam.locked index 660d463ec..e8e6444e3 100644 --- a/opam.locked +++ b/opam.locked @@ -38,7 +38,6 @@ depends: [ "camlidl" {= "1.05"} "camlp4" {= "4.07+1"} "camlzip" {= "1.08"} - "camomile" {= "1.0.1"} "cmdliner" {= "1.0.4"} "conf-autoconf" {= "0.1"} "conf-gmp" {= "1"} @@ -60,7 +59,7 @@ depends: [ "fieldslib" {= "v0.12.0"} "integers" {= "0.2.2"} "jane-street-headers" {= "v0.12.0"} - "javalib" {= "3.0"} + "javalib" {= "3.1"} "jbuilder" {= "transition"} "jst-config" {= "v0.12.0"} "menhir" {= "20190626"}