From 8f43bdf52170b095941c055b33b9effb8dffa17a Mon Sep 17 00:00:00 2001 From: Tony Hu Date: Thu, 8 Mar 2018 12:10:28 -0800 Subject: [PATCH] [java] Allow "empty" sources when loading from arguments Reviewed By: sblackshear, jeremydubreil Differential Revision: D7186411 fbshipit-source-id: ef174db --- infer/src/java/jMain.ml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/infer/src/java/jMain.ml b/infer/src/java/jMain.ml index c27bc82a3..0b9c39c18 100644 --- a/infer/src/java/jMain.ml +++ b/infer/src/java/jMain.ml @@ -141,12 +141,14 @@ let main load_sources_and_classes = let classpath, sources, classes = match load_sources_and_classes with | `FromVerboseOut verbose_out_file -> - JClasspath.load_from_verbose_output verbose_out_file + let classpath, sources, classes = JClasspath.load_from_verbose_output verbose_out_file in + if String.Map.is_empty sources then + L.(die InternalError) "Failed to load any Java source code" + else (classpath, sources, classes) | `FromArguments path -> JClasspath.load_from_arguments path in - if String.Map.is_empty sources then L.(die UserError) "Failed to load any Java source code" - else do_all_files classpath sources classes + do_all_files classpath sources classes let from_arguments path = main (`FromArguments path)