From c637c10d0f2b2e51db9f9dd4a2b00f9d6ccb33f3 Mon Sep 17 00:00:00 2001 From: Jules Villard Date: Fri, 11 Mar 2016 09:12:28 -0800 Subject: [PATCH] Revert "[java] no longer catching Class_structure_exception" Summary:public Revert 6fa9b995e5404e1417e8f2fca6bfa9b98c095c47 (D2843010). It's slightly less worse to silently ignore Java8 rather than crashing. We'll wait for an upstream fix to Javalib to resolve the issue of leaked file descriptors that the original diff was trying to address. Reviewed By: sblackshear Differential Revision: D3040978 fb-gh-sync-id: 4020221 shipit-source-id: 4020221 --- infer/src/java/jClasspath.ml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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 =