[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
master
Jeremy Dubreil 8 years ago committed by Facebook Github Bot
parent 75d6fb30e4
commit 02ce9a909a

@ -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 =

Loading…
Cancel
Save