Skip to content

Commit 66e6f4d

Browse files
committed
Use empty string as default value for string annotation values
1 parent 8a3ed6b commit 66e6f4d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

java/ql/src/utils/stub-generator/Stubs.qll

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,9 @@ private string stubAnnotationSimpleValue(Expr value) {
418418
value instanceof Literal or
419419
value instanceof CompileTimeConstantExpr
420420
) and
421-
result = stubDefaultValue(value.getType())
421+
if value instanceof StringLiteral
422+
then result = "\"\""
423+
else result = stubDefaultValue(value.getType())
422424
or
423425
// We can't use stubAnnotation here because it causes a non-monotonic recursion.
424426
// Handling the most basic case of a nested annotation for now.

0 commit comments

Comments
 (0)