fix(okhttp): remove internal API usage and fix deprecated OkHttp 5 calls#7444
Merged
manusa merged 1 commit intofabric8io:mainfrom Feb 18, 2026
Merged
fix(okhttp): remove internal API usage and fix deprecated OkHttp 5 calls#7444manusa merged 1 commit intofabric8io:mainfrom
manusa merged 1 commit intofabric8io:mainfrom
Conversation
Replace okhttp3.internal.http.HttpMethod.requiresRequestBody() with a local constant to avoid JPMS visibility issues in OkHttp 5.2+. Reorder RequestBody.create() parameters to the non-deprecated (content, MediaType) signature. Add explicit okhttp-jvm dependency to httpclient-okhttp. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #7422 (OkHttp 4.12.0 → 5.3.2 bump) addressing compatibility issues identified during review:
okhttp3.internal.http.HttpMethodusage: Replace the internal API callHttpMethod.requiresRequestBody()with a local constant set. OkHttp 5.2+ enforces Java 9 module boundaries (module-info.java), which will causepackage okhttp3.internal.http is not visibleerrors for users on the module path. This internal API has been fragile since the 3.x → 4.x upgrade (9fa6296 feat:deps: bumped OkHttp from 3.12.12 to 4.12.0 #6441).RequestBody.create()parameters: Thecreate(MediaType, content)overloads were deprecated in OkHttp 4.x in favor ofcreate(content, MediaType). Updated all three call sites to use the non-deprecated signature.okhttp-jvmdependency: In OkHttp 5.x, theokhttpartifact is a Kotlin Multiplatform root that may resolve to an empty JAR for Maven users. Thehttpclient-okhttpmodule was relying onlogging-interceptorto transitively pull inokhttp-jvm. Added the explicit dependency to prevent breakage if transitive resolution changes.Test plan
mvn clean install -pl httpclient-okhttp -am -DskipTestspassesmvn test -pl httpclient-okhttp— all 84 tests passmvn spotless:check -pl httpclient-okhttp— formatting clean🤖 Generated with Claude Code