Migrate to Apache HttpCore Nio Classes to Apache HttpCore 5.x

MSAL

Mapping of all the compatible classes of Apache HttpCore 5.x from Apache HttpCore Nio 4.4.x.

org.openrewrite.apache.httpclient5.UpgradeApacheHttpCore_5_NioClassMapping
mod run . --recipe=org.openrewrite.apache.httpclient5.UpgradeApacheHttpCore_5_NioClassMapping

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. Migrate from httpcore-nio to ApacheHttpClient 5.x core dependency
  2. Migrate to Apache HttpCore Nio Util Classes to Apache HttpCore 5.x
  3. Change type org.apache.http.impl.nio.reactor.IOReactorConfig to org.apache.hc.core5.reactor.IOReactorConfig
  4. Change method invocation return type
  5. Remove method invocations org.apache.hc.core5.reactor.IOReactorConfig getShutdownGracePeriod()
  6. Remove method invocations org.apache.hc.core5.reactor.IOReactorConfig isInterestOpQueued()
  7. Change method invocation return type
  8. Change method invocation return type
  9. Remove method invocations org.apache.hc.core5.reactor.IOReactorConfig getConnectTimeout()
  10. Change type org.apache.http.impl.nio.reactor.IOReactorConfig.Builder to org.apache.hc.core5.reactor.IOReactorConfig.Builder
  11. Changes an argument (or pair of arguments) to a TimeValue for matched method invocations org.apache.hc.core5.reactor.IOReactorConfig.Builder setSelectInterval(long)
  12. Remove method invocations org.apache.hc.core5.reactor.IOReactorConfig.Builder setShutdownGracePeriod(long)
  13. Remove method invocations org.apache.hc.core5.reactor.IOReactorConfig.Builder setInterestOpQueued(boolean)
  14. Adds a TimeUnit argument to the matched method invocations org.apache.hc.core5.reactor.IOReactorConfig.Builder setSoTimeout(int)
  15. Adds a TimeUnit argument to the matched method invocations org.apache.hc.core5.reactor.IOReactorConfig.Builder setSoLinger(int)
  16. Remove method invocations org.apache.hc.core5.reactor.IOReactorConfig.Builder setConnectTimeout(int)
  17. Change type ConnectingIOReactor to ConnectionInitiator
  18. Change type org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor to org.apache.hc.core5.reactor.DefaultConnectingIOReactor
  19. Migrate HttpAsyncMethods factory calls to HttpClient 5.x
  20. Inline hoisted locals used by new BasicAsyncRequestProducer(...)
  21. Migrate BasicAsyncRequestProducer to AsyncRequestBuilder
  22. Change type NStringEntity to StringEntity
  23. Change type NByteArrayEntity to ByteArrayEntity
  24. Change type NFileEntity to FileEntity