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) {
414414private string stubAnnotationSimpleValue ( Expr value ) {
415415 result = value .( FieldAccess ) .getField ( ) .getQualifiedName ( )
416416 or
417- result = value .( Literal ) .getLiteral ( )
418- or
419- not value instanceof Literal and
420417 (
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 ( ) )
425422 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 ( )
427426 or
428427 result = value .( TypeLiteral ) .getReferencedType ( ) .getName ( ) + ".class"
429428}
@@ -435,6 +434,7 @@ private string stubAnnotationValue(Expr value) {
435434 result =
436435 "{" +
437436 concat ( int i , Expr arrayElement |
437+ i >= 0 and
438438 arrayElement = value .( ArrayInit ) .getInit ( i )
439439 |
440440 stubAnnotationSimpleValue ( arrayElement ) , "," order by i
You can’t perform that action at this time.
0 commit comments