Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix groovy multivariable declaration #4757
Fix groovy multivariable declaration #4757
Changes from 19 commits
44c138b
e2ac9f4
f9f3cd3
9274748
eb95dbb
0685d0e
06973e1
a0da837
d9856a8
ff0510a
27e95f1
4278625
d22d5ff
3553b1f
bbdd436
3786a05
addfd85
422df9e
0a92ffe
f301c34
f196837
9b906d2
7cd916b
b371832
f4bb9b7
7de11c8
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps good to call out here that we now model
final def
anddef final
as two unique concatenated Identifiers, which seems odd to me:Note that I don't expect this to occur often, if at all, and it still prints OK; but figured comment it here for a closer look by others reviewing as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While this isn't perfect either, I think I would opt for mapping all of
final
,def
, andvar
to modifiers (J.Modifier
) and instead deprecating theRedundantDef
marker, while still supporting it in the printer to remain backwards compatible.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implemented this. I'm not sure if we can actually mark the
RedundantDef
marker as deprecated though as that may also apply to declared methods, so I left that in.As we discussed we may want to find a way to combine consecutive
DeclarationExpression
s into oneJ.VariableDeclarations
. That could be a further improvement and I'm willing to work on that, but want to return focus to the parenthesis issue as well :)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At least marking the
RedundantDef
marker as @deprecated should not be a problem. If you have the option to remove themaybeRedundantDef
method as well, all the better. As long as you keep theRedundantDef
marker in printer, you are still backwards compatible.__
Also notice the
RedundantDef
marker has ben added lately (05/12/2024). So the sooner we no longer use it, the less serialised LSTs do have this marker.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sambsnyd Since you recently added that
RedundantDef
, do you also want to chime in here and tell us what your thoughts are about this?