Skip to content
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

Add fallback for determining parenthesis level for BinaryExpression #4807

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Laurens-W
Copy link
Contributor

What's changed?

Added fallback for determining parenthesis level for BinaryExpression

Anyone you would like to review specifically?

@timtebeek @jevanlingen @knutwannheden @sambsnyd

Any additional context

Lower versions of Gradle do not provide the _INSIDE_PARENTHESES_LEVEL flag we expect

Checklist

  • I've added unit tests to cover both positive and negative cases
  • I've read and applied the recipe conventions and best practices
  • I've used the IntelliJ IDEA auto-formatter on affected files

…ssion` when AST doesn't provide `_INSIDE_PARENTHESES_LEVEL` flag
@Laurens-W Laurens-W added the bug Something isn't working label Dec 20, 2024
@Laurens-W Laurens-W self-assigned this Dec 20, 2024
Copy link
Contributor

@timtebeek timtebeek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved already, but let's await the results you get locally with the jar I've just sent.

@jevanlingen
Copy link
Contributor

Maybe it's also a good idea to add an extra comment above the usage of _INSIDE_PARENTHESES_LEVEL. Something like:

private static @Nullable Integer getInsideParenthesesLevel(ASTNode node) {
  // Grab level from AST if provided (older groovy does not set this flag at all, newer versions omit this flag for MethodCallExpression nodes)
  Object rawIpl = node.getNodeMetaData("_INSIDE_PARENTHESES_LEVEL");
   ..
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Ready to Review
Development

Successfully merging this pull request may close these issues.

3 participants