[infer][Java] Deal with empty strings '' in the classpath

Summary:
@public
The empty string '' is a valid classpath information. This diff parses it and skips it when detecting the parts of the classpath. This case is happening when analyzing Buck. This one be one possibility why Infer does not load any bytecode in some cases, leading the

  TODO: print error message

failure happening with the release (now `Failed to load any Java source code`).

Test Plan: Infer CI.
master
jrm 10 years ago
parent 0c6db22ae4
commit fda373c706

@ -37,6 +37,7 @@ rule token = parse
| ']' { RIGHT_SQUARE_BRACKET }
| ':' { COLON }
| ',' { COMMA }
| "\'\'" { EMPTY }
| "parsing" { PARSING }
| "started" { STARTED }
| "wrote" { WROTE }

@ -5,6 +5,7 @@
%token EOL EOF
%token LEFT_SQUARE_BRACKET RIGHT_SQUARE_BRACKET
%token COLON COMMA
%token EMPTY
%token PARSING STARTED WROTE SEARCH_PATH
%token REGULARFILEOBJECT ZIPFILEINDEXFILEOBJECT
%token <string> CLASS_FILENAME
@ -34,6 +35,8 @@ classpath:
;
classpath_parts:
| EMPTY { [] }
| PATH { [$1] }
| EMPTY COMMA classpath_parts { $3 }
| PATH COMMA classpath_parts { $1 :: $3 }
;

Loading…
Cancel
Save