diff --git a/infer/src/java/jClasspath.ml b/infer/src/java/jClasspath.ml index 081f484e5..ce606f10b 100644 --- a/infer/src/java/jClasspath.ml +++ b/infer/src/java/jClasspath.ml @@ -176,6 +176,7 @@ let load_sources_and_classes () = | JVerbose.Classpath parsed_paths -> loop parsed_paths roots sources classes with + | JBasics.Class_structure_error _ | Parsing.Parse_error | Invalid_argument _ | Failure "lexing: empty token" -> loop paths roots sources classes @@ -255,9 +256,11 @@ let collect_classes 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 - let classes = IList.fold_left collect classmap (extract_classnames [] jar_filename) in - Javalib.close_class_path classpath; - classes + 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 let load_program classpath classes =