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:
Tamás Vajk
2022-01-12 13:03:16 +01:00
committed by GitHub
16 changed files with 55 additions and 55 deletions

View File

@@ -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) + ", ...;"
}