Jakarta Servlet methods have been deprecated for removal in Jakarta Servlet 6.0 to align with RFC 6265. In addition, the behavior of these methods has been changed so the setters no longer have any effect, the getComment methods return null, and the getVersion method returns 0. The deprecated methods are removed.
This recipe is composed of more than one recipe. If you want to customize the set of recipes this is composed of, you can find and copy the GitHub source for the recipe from the link above.
Usage
This recipe has no required configuration options. It can be activated by adding a dependency on org.openrewrite.recipe:rewrite-migrate-java:2.12.0 in your build file or by running a shell command (in which case no build changes are needed):
---type:specs.openrewrite.org/v1beta/recipename:org.openrewrite.java.migrate.jakarta.ServletCookieBehaviorChangeRFC6265displayName:Remove `getComment` and `getVersion` methodsdescription: Jakarta Servlet methods have been deprecated for removal in Jakarta Servlet 6.0 to align with RFC 6265. In addition, the behavior of these methods has been changed so the setters no longer have any effect, the getComment methods return null, and the getVersion method returns 0. The deprecated methods are removed.
recipeList: - org.openrewrite.java.migrate.RemoveMethodInvocation:methodPattern:jakarta.servlet.http.Cookie getComment() - org.openrewrite.java.migrate.RemoveMethodInvocation:methodPattern:jakarta.servlet.http.Cookie getVersion() - org.openrewrite.java.migrate.RemoveMethodInvocation:methodPattern:jakarta.servlet.http.Cookie setComment(String) - org.openrewrite.java.migrate.RemoveMethodInvocation:methodPattern:jakarta.servlet.http.Cookie setVersion(int) - org.openrewrite.java.migrate.RemoveMethodInvocation:methodPattern:jakarta.servlet.SessionCookieConfig getComment() - org.openrewrite.java.migrate.RemoveMethodInvocation:methodPattern:jakarta.servlet.SessionCookieConfig setComment(String)
See how this recipe works across multiple open-source repositories
The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories.
Please contact Moderne for more information about safely running the recipes on your own codebase in a private SaaS.