run mvn -P openrewrite org.openrewrite.maven:rewrite-maven-plugin:run -l rewrite.log
check the repo if any files changed.
a. If no files changed, decrease the value of the variable limit in RightnameGetter and goto item 2.
b. If files have changes, increase the value of the variable limit in RightnameGetter and goto item 2.
As you can observe the recipe works if called with a low enough value for the variable limit.
What's the Problem?
When it doesn't work, there is no indication as to why. There is a "build success" at the end and no files change, same as if there was simply nothing to do. But as we can see with lower values for limit there is something to do. When there are enough findings the recipe simply doesn't do anything and pretends that everything is fine. Instead, OpenRewrite should tell me in the log that the recipe failed and give a clue whether this is because of the recipe or an internal OpenRewrite bug.
Indicating that this is where the execution stops. I'm not sure why that is.
a. I could have programmed it wrong. If I did, I don't understand why, it does work for lower values. Maybe I used the API in a way that it not intended? Then I would appreciate an explanation and if applicable a refined documentation.
b. Java 8 can't handle streams longer than 150 elements being collected into maps. Unlikely
c. OpenRewrite has a memory bottleneck and fails silently if that happens. Sort of unlikely since the logs stop being printed long before I would expect.
Context
The point of the recipe is to accumulate methods that should be renamed. In a second step these renamings are executed. I've implemented this with a scanning recipe that scans for renaming opportunities and passes those to the visitor of a modified ChangeMethodName that can rename several methods through loops.
How are you running OpenRewrite?
I am using the Maven plugin, and my project is a single module project.
What is the way to reproduce the problem?
publishToMavenLocal
in gradlemvn -P openrewrite org.openrewrite.maven:rewrite-maven-plugin:run -l rewrite.log
limit
inRightnameGetter
and goto item 2. b. If files have changes, increase the value of the variablelimit
inRightnameGetter
and goto item 2.As you can observe the recipe works if called with a low enough value for the variable limit.
What's the Problem?
When it doesn't work, there is no indication as to why. There is a "build success" at the end and no files change, same as if there was simply nothing to do. But as we can see with lower values for
limit
there is something to do. When there are enough findings the recipe simply doesn't do anything and pretends that everything is fine. Instead, OpenRewrite should tell me in the log that the recipe failed and give a clue whether this is because of the recipe or an internal OpenRewrite bug.Possible Bug in OpenRewrite. If the recipe doesn't work then there are no
System.out
logs printed after this line: https://github.com/timo-a/rewrite-recipe-starter/blob/0372af55b5851b2cff78e227e91836621a90b299/src/main/java/io/github/timoa/lombok/RightnameGetter.java#L142-L146Indicating that this is where the execution stops. I'm not sure why that is. a. I could have programmed it wrong. If I did, I don't understand why, it does work for lower values. Maybe I used the API in a way that it not intended? Then I would appreciate an explanation and if applicable a refined documentation. b. Java 8 can't handle streams longer than 150 elements being collected into maps. Unlikely c. OpenRewrite has a memory bottleneck and fails silently if that happens. Sort of unlikely since the logs stop being printed long before I would expect.
Context
The point of the recipe is to accumulate methods that should be renamed. In a second step these renamings are executed. I've implemented this with a scanning recipe that scans for renaming opportunities and passes those to the visitor of a modified
ChangeMethodName
that can rename several methods through loops.Are you interested in contributing a fix to OpenRewrite?
No