Skip to content

Commit 6f7b7c9

Browse files
committed
If an annotation value is an array, order its elements by index
1 parent 6f1124d commit 6f7b7c9

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,13 @@ private string stubAnnotationValue(Expr value) {
432432
result = stubAnnotationSimpleValue(value)
433433
or
434434
value instanceof ArrayInit and
435-
result = "{" + concat(stubAnnotationSimpleValue(value.(ArrayInit).getAnInit()), ",") + "}"
435+
result =
436+
"{" +
437+
concat(int i, Expr arrayElement |
438+
arrayElement = value.(ArrayInit).getInit(i)
439+
|
440+
stubAnnotationSimpleValue(arrayElement), "," order by i
441+
) + "}"
436442
}
437443

438444
bindingset[s]

0 commit comments

Comments
 (0)