Skip to content

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

Merged
jlerbsc merged 1 commit into
javaparser:masterfrom
johannescoetzee:johannes/switch-parsing-fix
May 30, 2024
Merged

Fix expressions in the body of switch expression entries (Issue 4440)#4446
jlerbsc merged 1 commit into
javaparser:masterfrom
johannescoetzee:johannes/switch-parsing-fix

Conversation

@johannescoetzee

Copy link
Copy Markdown
Collaborator

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.

@codecov

codecov Bot commented May 30, 2024

Copy link
Copy Markdown

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