From 02ce9a909a12b64df55200f93b4d5c69f0d9b7dc Mon Sep 17 00:00:00 2001 From: Jeremy Dubreil Date: Mon, 14 Nov 2016 21:15:45 -0800 Subject: [PATCH] [infer][java] only skip the classes where Javalib raises an exception instead of skipping all the classes Summary: If seems that we were dropping succesful loaded classes for no reason Reviewed By: sblackshear Differential Revision: D4178079 fbshipit-source-id: 827c0b9 --- infer/src/java/jClasspath.ml | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/infer/src/java/jClasspath.ml b/infer/src/java/jClasspath.ml index d0922021b..a76e66189 100644 --- a/infer/src/java/jClasspath.ml +++ b/infer/src/java/jClasspath.ml @@ -260,15 +260,20 @@ let extract_classnames classnames jar_filename = classnames_after -let collect_classes classmap jar_filename = +let collect_classes start_classmap jar_filename = let classpath = Javalib.class_path jar_filename in let collect classmap cn = - JBasics.ClassMap.add cn (Javalib.get_class classpath cn) classmap in - try - let classes = IList.fold_left collect classmap (extract_classnames [] jar_filename) in - Javalib.close_class_path classpath; - classes - with JBasics.Class_structure_error _ -> classmap + try + JBasics.ClassMap.add cn (Javalib.get_class classpath cn) classmap + with JBasics.Class_structure_error _ -> + classmap in + let classmap = + IList.fold_left + collect + start_classmap + (extract_classnames [] jar_filename) in + Javalib.close_class_path classpath; + classmap let load_program classpath classes =