mirror of
https://github.com/github/codeql.git
synced 2026-05-02 20:25:13 +02:00
Merge pull request #7573 from tamasvajk/fix/java-field-decl-tostr
Java: Fix toString on field declarations with single field
This commit is contained in:
@@ -587,7 +587,7 @@ class FieldDeclaration extends ExprParent, @fielddecl, Annotatable {
|
||||
int getNumField() { result = max(int idx | fieldDeclaredIn(_, this, idx) | idx) + 1 }
|
||||
|
||||
override string toString() {
|
||||
if this.getNumField() = 0
|
||||
if this.getNumField() = 1
|
||||
then result = this.getTypeAccess() + " " + this.getField(0) + ";"
|
||||
else result = this.getTypeAccess() + " " + this.getField(0) + ", ...;"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user