Skip to content

Fix expressions in the body of switch expression entries (Issue 4440) #4446

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

Merged

Conversation

johannescoetzee
Copy link
Contributor

Fixes #4440

I introduced this bug in #4364 to fix an issue with the LPP by expecting a StatementExpression instead of an Expression in the body of a switch statement. This did fix the semi-colon issue I had, but I didn't consider the fact that StatementExpression isn't just a wrapper around an Expression, but actually a proper subset. This meant that a lot of expression types were not supported anymore.

This PR changes this back. I didn't run into the same LPP issue again, so I suspect I just didn't understand how sequences should be parenthesized or something like that before.

Copy link

codecov bot commented May 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 51.999%. Comparing base (33b200f) to head (979c7bf).
Report is 1 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##            master     #4446   +/-   ##
=========================================
  Coverage   51.999%   51.999%           
=========================================
  Files          507       507           
  Lines        28654     28654           
  Branches      4969      4969           
=========================================
  Hits         14900     14900           
  Misses       11685     11685           
  Partials      2069      2069           
Flag Coverage Δ
AlsoSlowTests 51.999% <ø> (ø)
javaparser-core 51.999% <ø> (ø)
javaparser-symbol-solver 51.999% <ø> (ø)
jdk-10 51.996% <ø> (ø)
jdk-11 51.996% <ø> (ø)
jdk-12 51.996% <ø> (ø)
jdk-13 51.996% <ø> (ø)
jdk-14 51.996% <ø> (ø)
jdk-15 51.996% <ø> (ø)
jdk-16 51.996% <ø> (ø)
jdk-17 51.996% <ø> (ø)
jdk-18 51.996% <ø> (ø)
jdk-8 51.994% <ø> (ø)
jdk-9 51.996% <ø> (ø)
macos-latest 51.992% <ø> (ø)
ubuntu-latest 51.992% <ø> (ø)
windows-latest 51.978% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 61d3619...979c7bf. Read the comment docs.

@jlerbsc jlerbsc merged commit ee73b9f into javaparser:master May 30, 2024
@jlerbsc jlerbsc added this to the next release milestone May 30, 2024
@jlerbsc jlerbsc added the PR: Fixed A PR that offers a fix or correction label May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: Fixed A PR that offers a fix or correction
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Problems parsing SwitchExpr with Unary/BinaryOperators
2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy