File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
java/ql/src/utils/stub-generator Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -414,16 +414,15 @@ private string stubAnnotation(Annotation a) {
414
414
private string stubAnnotationSimpleValue ( Expr value ) {
415
415
result = value .( FieldAccess ) .getField ( ) .getQualifiedName ( )
416
416
or
417
- result = value .( Literal ) .getLiteral ( )
418
- or
419
- not value instanceof Literal and
420
417
(
421
- result = value . ( CompileTimeConstantExpr ) . getStringValue ( ) or
422
- result = value . ( CompileTimeConstantExpr ) . getBooleanValue ( ) . toString ( ) or
423
- result = value . ( CompileTimeConstantExpr ) . getIntValue ( ) . toString ( )
424
- )
418
+ value instanceof Literal or
419
+ value instanceof CompileTimeConstantExpr
420
+ ) and
421
+ result = stubDefaultValue ( value . getType ( ) )
425
422
or
426
- result = value .( Annotation ) .getType ( ) .getName ( )
423
+ // We can't use stubAnnotation here because it causes a non-monotonic recursion.
424
+ // Handling the most basic case of a nested annotation for now.
425
+ result = "@" + value .( Annotation ) .getType ( ) .getName ( )
427
426
or
428
427
result = value .( TypeLiteral ) .getReferencedType ( ) .getName ( ) + ".class"
429
428
}
@@ -435,6 +434,7 @@ private string stubAnnotationValue(Expr value) {
435
434
result =
436
435
"{" +
437
436
concat ( int i , Expr arrayElement |
437
+ i >= 0 and
438
438
arrayElement = value .( ArrayInit ) .getInit ( i )
439
439
|
440
440
stubAnnotationSimpleValue ( arrayElement ) , "," order by i
You can’t perform that action at this time.
0 commit comments