-
Notifications
You must be signed in to change notification settings - Fork 55
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
Add @Serial annotation to serialVersionUID not working #344
Comments
hi! The recipe does indeed require that you're running at least Java 17, as determined by a marker that we upgrade as part of a Java version bump. Linking the relevant components here. Lines 54 to 57 in 5c43d94
Earlier today I'd also added a test to see if we do indeed add the annotation if the field is new: that seems to work: 5c43d94 And updating the Java version is pretty much the first thing we do on any Java migration: https://github.com/openrewrite/rewrite-migrate-java/blob/1931a6fd3f3999dc20d57b0907d1251447640b07/src/main/resources/META-INF/rewrite/java-version-17.yml#L28-L30 |
OK test case:
Notice nothing gets touched in the |
Thanks for the reproducer steps.. Can't yet look in detail as I'm traveling/PTO for the next week or so, followed by conference. Any help appreciated! |
Using the latest version of this recipe: https://docs.openrewrite.org/recipes/staticanalysis/addserialannotationtoserialversionuid
Just tested that Standalone on two Java projects and it did not add the annotation to any
private static final long serialVersionUID = 1L;
Does it do some detection that the pom.xml is already Java14 or higher? Because we are trying to run this as part of the JDK17 Recipe?
The text was updated successfully, but these errors were encountered: