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

Groovy parser does not correctly handle nested parenthesis #4703

Closed
sambsnyd opened this issue Nov 23, 2024 · 2 comments
Closed

Groovy parser does not correctly handle nested parenthesis #4703

sambsnyd opened this issue Nov 23, 2024 · 2 comments
Assignees
Labels
bug Something isn't working parser-groovy

Comments

@sambsnyd
Copy link
Member

sambsnyd commented Nov 23, 2024

When we attempt to parse:

def foo(Map map) {
    ((map.containsKey("foo"))
            && ((map.get("foo")).equals("bar")))
}

def timestamp(int hours, int minutes, int seconds) {
    (hours) * 60 * 60 + (minutes * 60) + seconds
}

What we actually get is an IllegalStateException out of the parser.

Reproduced in BinaryTest.extraParensAroundInfixOperator()

@timtebeek
Copy link
Contributor

Half of this has already been fixed through

@jevanlingen
Copy link
Contributor

Other half has been fixed today:

@github-project-automation github-project-automation bot moved this from Backlog to Done in OpenRewrite Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working parser-groovy
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants