-
Notifications
You must be signed in to change notification settings - Fork 354
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
IllegalArgumentException when parsing a file #4488
Comments
Three observations:
Thus I think we need more details/context in order to proceed with this bug. |
I excluded those files from the analysis, that make problems. Did you remove the exclusion? When I remove the exclusions I get the StackOverFlowException for
and the IAE for
|
I can try to create a self-contained example from the code above. |
I did not. That was my mistake. Makes sense now. |
Using the latest releases of |
Thanks for fixing this! I can confirm that the IAE is not thrown anymore. I still get the StackOverflowException for |
It looks like the bug appears again. I isolated the problem in uhafner/codingstyle#1227, see maven output of https://github.com/uhafner/codingstyle/actions/runs/11794757482/job/32853026811?pr=1227 I'll try to create a test case but I am still struggling with the required imports that are not available in the unit test... |
@mccartney @knutwannheden I'm not sure if you follow closed issues but GitHub does not support reopening tickets. I still have the problem from above with in my codingstyle project. I exposed a build in a PR that shows the problem: https://github.com/uhafner/codingstyle/actions/runs/11798330588/job/32864251636?pr=1227 I tried to add a test in rewrite but I am struggling with your tooling. The following test succeeds (as test and when the file is used as real example in my project).
When I add the JavaDoc comments then the test cannot be started:
What am I doing wrong? I get in my IDE:
The problematic part of the exception in rewrite-java seems to be the JavaDoc that references the link to the methods. If I remove the links, then everything is green. This seems to be the actual problem behind the exception:
|
@uhafner Thanks Ulli. We will take another look. |
I'm not sure which version upgrade fixed the problem, but with
the exception cannot be reproduced anymore, see: https://github.com/uhafner/codingstyle/actions/runs/11911694185/job/33193741872?pr=1227 |
Great to hear, and thanks for coming back to close the issue. Do note that we also offer a rewrite-recipe-bom, which would reduce the versions you need to maintain to just the bom version and plugin version, both updated in sync every two weeks. |
Thanks, I wasn't aware of that. But it looks that this does not yet work in Maven for build plugins (it does work for project dependencies). In your documentation I also found the caveat:
|
Ah of course yes; I hadn't looked at your project yet but we often see folks develop their own recipe library, specify bom managed transitive dependency versions there, and then only depend on their own recipe library in their plugin configuration. I now see your setup is different and indeed would need to be more explicit about versions for now. |
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. I did run the command
mvn -X clean rewrite:run
.See https://github.com/uhafner/codingstyle for details. The OpenRewrite configuration is visible in the pom.xml.
What is the smallest, simplest way to reproduce the problem?
What did you expect to see?
No exception.
What did you see instead?
Exception, see stacktrace below.
What is the full stack trace of any errors you encountered?
Are you interested in [contributing a fix to OpenRewrite]
Not right now.
The text was updated successfully, but these errors were encountered: