From 2e7956f384fe4b4bcd5fd3377a6a68fe2014896b Mon Sep 17 00:00:00 2001 From: jrm Date: Thu, 21 Jan 2016 22:45:51 -0800 Subject: [PATCH] Always use the current directory as the default classpath Summary: public When no classpath was specified, Infer were considering it to be None instead of the current directory. The consequence is that we were replacing the current directory with the annotation processor for suppress warnings, leading to cases where `javac` was compiling fine but `infer -- javac` was failing with classes not found compilation issues. This diff fixes by always having at least "." in the classpath. Reviewed By: sblackshear Differential Revision: D2853035 fb-gh-sync-id: e69db7c --- infer/lib/python/inferlib/jwlib.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/infer/lib/python/inferlib/jwlib.py b/infer/lib/python/inferlib/jwlib.py index 45e082ecd..5cac00b30 100644 --- a/infer/lib/python/inferlib/jwlib.py +++ b/infer/lib/python/inferlib/jwlib.py @@ -23,7 +23,8 @@ current_directory = os.getcwd() parser.add_argument('-version', action='store_true') parser.add_argument('-deprecation', action='store_true') -parser.add_argument('-cp', '-classpath', type=str, dest='classpath') +parser.add_argument('-cp', '-classpath', type=str, + dest='classpath', default=os.getcwd()) parser.add_argument('-bootclasspath', type=str) parser.add_argument('-d', dest='classes_out', default=current_directory) parser.add_argument('-processorpath', type=str, dest='processorpath') @@ -74,14 +75,10 @@ class CompilerCall: self.args.processorpath]) javac_cmd += ['-processorpath', processorpath] else: - if classpath is not None: - classpath = os.pathsep.join([config.ANNOT_PROCESSOR_JAR, - classpath]) - else: - classpath = config.ANNOT_PROCESSOR_JAR - - if classpath is not None: - javac_cmd += ['-classpath', classpath] + classpath = os.pathsep.join([config.ANNOT_PROCESSOR_JAR, + classpath]) + + javac_cmd += ['-classpath', classpath] # this overrides the default mechanism for discovering annotation # processors (checking the manifest of the annotation processor