-
Notifications
You must be signed in to change notification settings - Fork 21
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
Log4jToSlf4j Single Statement If Could not parse as Java
#185
Closed
Labels
bug
Something isn't working
Comments
FlorianWege-HS-KL
changed the title
Single Statement If Oct 28, 2024
Could not parse as Java
Could not parse as Java
hi! This looks to be an issue with one particular recipe; would you mind creating a draft PR containing just one additional test based on this example that matches your case? rewrite-logging-frameworks/src/test/java/org/openrewrite/java/logging/ParameterizedLoggingTest.java Lines 41 to 68 in 71ac5c4
|
FlorianWege-HS-KL
changed the title
Single Statement If
Log4jToSlf4j Single Statement If Oct 28, 2024
Could not parse as Java
Could not parse as Java
4 tasks
timtebeek
added a commit
to openrewrite/rewrite
that referenced
this issue
Nov 24, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What version of OpenRewrite are you using?
I am using
How are you running OpenRewrite?
I am using the Maven plugin, and my project is a single module project.
What is the smallest, simplest way to reproduce the problem?
mvn rewrite:run
while having the following Java source file:
What did you expect to see?
no parse error
What did you see instead?
parse error (see error message/stack trace)
What is the full stack trace of any errors you encountered?
Debugging the parse instruction there,
jp.reset().parse(ctx, stub).findFirst()
yields:Are you interested in contributing a fix to OpenRewrite?
I do not know how to fix it at the moment. But I suspect it is the single statement if structure that is not correctly parsed/transformed. When the second string literal
"second"
in the log statement, thebar
function below is removed, or the then branch of the if structure uses curly braces, the run succeeds.The text was updated successfully, but these errors were encountered: