Fix stub generator

Add line break after all stubbed annotations to avoid malformed code

See https://github.com/github/codeql/pull/8695\#discussion_r985674245
This commit is contained in:
Tony Torralba
2022-10-03 14:27:07 +02:00
parent d52d3d7b75
commit ba9eb8c73c
2 changed files with 10 additions and 7 deletions

View File

@@ -36,12 +36,15 @@ abstract private class GeneratedType extends ClassOrInterface {
}
private string stubAnnotations() {
result =
concat(Annotation an |
this.(AnnotationType).getAnAnnotation() = an
|
stubAnnotation(an), "\n" order by an.getType().getQualifiedName()
)
if exists(this.(AnnotationType).getAnAnnotation())
then
result =
concat(Annotation an |
this.(AnnotationType).getAnAnnotation() = an
|
stubAnnotation(an), "\n" order by an.getType().getQualifiedName()
) + "\n"
else result = ""
}
/** Gets the entire Java stub code for this type. */