Skip to content
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

improve the error prone situation #14200

Closed
rmuir opened this issue Feb 5, 2025 · 7 comments · Fixed by #14201
Closed

improve the error prone situation #14200

rmuir opened this issue Feb 5, 2025 · 7 comments · Fixed by #14201

Comments

@rmuir
Copy link
Member

rmuir commented Feb 5, 2025

Description

Currently this tool struggles to work with JDK21. maybe we can find a version that works or some workaround?
It is also slow, so slow that we only run it in the CI, which isn't great.

I spent a lot of time previously trying to limit the number of rules so that it isn't so slow, but when it barfs completely on NoSuchMethodError or whatever, there is no choice but to disable it.

Another idea that has worked, revisit what checks are available in the ecj (which is fast). Maybe it has some new ones that we can turn on that overlap with the functionality. Maybe we can use another fast syntax-based tool such as ast-grep to implement some of these checks.

Otherwise we have to fix it to play well with the JDK. This isn't a problem with JDK24 or anything, issues are being hit with JDK21.

@risdenk
Copy link
Contributor

risdenk commented Feb 5, 2025

I'm not disagreeing with any of your statements about problems with errorprone, but for completeness there are much newer versions of errorprone (2.36.0 is latest https://github.com/google/error-prone/releases)

currently on 2.18.0 https://github.com/apache/lucene/blob/main/versions.toml#L8

@rmuir
Copy link
Member Author

rmuir commented Feb 5, 2025

@risdenk I think part of my frustration is that I tried the latest version and it still fails with the JDK21 in compiler internals, just in a different way.

@rmuir
Copy link
Member Author

rmuir commented Feb 5, 2025

Here is the different error that I see on the latest version: I don't understand it:

2: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':lucene:core.tests:compileJava'.
> The default --should-stop=ifError policy (INIT) is not supported by Error Prone, pass --should-stop=ifError=FLOW instead

@rmuir
Copy link
Member Author

rmuir commented Feb 5, 2025

I tracked that one down to the 2.34.0. I will try 2.33.0! Maybe it works.

@rmuir
Copy link
Member Author

rmuir commented Feb 5, 2025

2.33.0 is better. I will make a PR.

@rmuir
Copy link
Member Author

rmuir commented Feb 5, 2025

Should be ready shortly. there are new violations, so I'm having to do some fixing. iterating with the error-prone on my dual-core 2018 computer is... painful :)

@risdenk
Copy link
Contributor

risdenk commented Feb 8, 2025

The error described above is fixed in #14216 by upgrading the errorprone plugin when upgrading errorprone itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants