Skip to content

[java] Improve ASTLocalVariableDeclaration #1128

@jsotuyod

Description

@jsotuyod

As per #1046 (comment)

ASTLocalVariableDeclaration.getVariableName() returns the name of the first variable declarator id, but there may be more in the case of byte var1, var2, var3; and even the types may be slightly different thanks to arrays (ie: byte var1, var2[], var3[][];).

The Javadoc for getVariableName says this, but I fail to find a use-case where only the first one is going to be needed... I think we should deprecate it and simply have ASTLocalVariableDeclaration implement Iterable<ASTVariableDeclarator> and we should just use those...

Metadata

Metadata

Assignees

No one assigned

    Labels

    in:astAbout the AST structure or API, the parsing step

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions