Migrate Struts 2.0 interceptors to action "aware" interfaces

Proprietary

These types have moved to a new package in Struts 6.0 and their methods have been renamed from set* to with*.

org.openrewrite.java.struts.migrate6.MigrateAwareInterfaces
mod run . --recipe=org.openrewrite.java.struts.migrate6.MigrateAwareInterfaces

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.

Recipe list

It runs these recipes, in this order.

  1. Change method name org.apache.struts2.interceptor.ApplicationAware setApplication(java.util.Map) to withApplication
  2. Change method name org.apache.struts2.interceptor.SessionAware setSession(java.util.Map) to withSession
  3. Change method name org.apache.struts2.interceptor.ParameterAware setParameters(java.util.Map) to withParameters
  4. Change method name org.apache.struts2.interceptor.HttpParametersAware setParameters(org.apache.struts2.dispatcher.HttpParameters) to withParameters
  5. Change method name org.apache.struts2.interceptor.PrincipalAware setPrincipalProxy(org.apache.struts2.interceptor.PrincipalProxy) to withPrincipalProxy
  6. Change method name org.apache.struts2.interceptor.ServletRequestAware setServletRequest(javax.servlet.http.HttpServletRequest) to withServletRequest
  7. Change method name org.apache.struts2.interceptor.ServletResponseAware setServletResponse(javax.servlet.http.HttpServletResponse) to withServletResponse
  8. Change method name org.apache.struts2.util.ServletContextAware setServletContext(javax.servlet.ServletContext) to withServletContext
  9. Change method name org.apache.struts2.interceptor.CookiesAware setCookiesMap(java.util.Map) to withCookiesMap
  10. Change method name org.apache.struts2.interceptor.RequestAware setRequest(java.util.Map) to withRequest
  11. Change type org.apache.struts2.interceptor.ApplicationAware to org.apache.struts2.action.ApplicationAware
  12. Change type org.apache.struts2.interceptor.CookiesAware to org.apache.struts2.action.CookiesAware
  13. Change type HttpParametersAware to ParametersAware
  14. Change type ParameterAware to ParametersAware
  15. Change type org.apache.struts2.interceptor.PrincipalAware to org.apache.struts2.action.PrincipalAware
  16. Change type RequestAware to ServletRequestAware
  17. Change type org.apache.struts2.interceptor.ServletRequestAware to org.apache.struts2.action.ServletRequestAware
  18. Change type org.apache.struts2.interceptor.ServletResponseAware to org.apache.struts2.action.ServletResponseAware
  19. Change type org.apache.struts2.interceptor.SessionAware to org.apache.struts2.action.SessionAware
  20. Change type org.apache.struts2.util.ServletContextAware to org.apache.struts2.action.ServletContextAware