Remove crossinline `addInterceptor` and `addNetworkInterceptor` overloads
Maintainers usually reply within 1 day
@Amir-Golmoradi is already working on this.
Since Oct 8, 2026.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 58/100
- Issue type
- Refactor
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- kotlin
- Domain
- backend-api-design
Research direction
Find the builder definitions of addInterceptor and addNetworkInterceptor shown in the issue, then read their call sites and existing tests. Check that removing the overloads leaves Kotlin lambda calls working through the SAM interface and does not introduce Java overload ambiguity; run the relevant tests. Done when both redundant overloads are removed and those usages remain covered.
Written by the indexing model from the issue text.
Description
I'm talking about these:
@JvmName("-addInterceptor") // Prefix with '-' to prevent ambiguous overloads from Java.
inline fun addInterceptor(crossinline block: (chain: Interceptor.Chain) -> Response) =
addInterceptor(Interceptor { chain -> block(chain) })
@JvmName("-addNetworkInterceptor") // Prefix with '-' to prevent ambiguous overloads from Java.
inline fun addNetworkInterceptor(crossinline block: (chain: Interceptor.Chain) -> Response) =
addNetworkInterceptor(Interceptor { chain -> block(chain) })
The two APIs are redundant -- Because we can directly pass a SAM lambda in Kotlin. The worse thing is, current Kotlin compiler won't make crossinlined SAM (interface Interceptor) to be invokedynamic, so one new class will be generated when we use this in Kotlin.
They are safe to remove (all Kotlin callsite are complied into addInterceptor(new Interceptor() { ... })
- Dominant language
- Kotlin
- Stars
- 47.1k
- Forks
- 9.3k
- Avg merge
- 18h 18m
- Merged PRs (30d)
- 15
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from lysine-dev/okhttp
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
lysine-dev/okhttp#9788 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
lysine-dev/okhttp#9761 · 3 comments ·
Maintainers usually reply within 1 day
-
HTTP/2 Data padding is not counted toward the connection flow-control window. This deadlocks connections with peers that pad.Possibly taken @Amir-Golmoradi claimed this 4 days ago. Openbug
Difficulty 3/5 1-2 days Newbie friendliness 67/100
lysine-dev/okhttp#9772 · 6 comments ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 55/100
lysine-dev/okhttp#9760 · 3 comments ·
Maintainers usually reply within 1 day
-
Unexpected Hostname Causing Crash in AndroidMay be free again A pull request for this issue was closed without being merged. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
lysine-dev/okhttp#9758 · 4 reactions ·
Maintainers usually reply within 1 day
All issues in lysine-dev/okhttp
Similar issues
-
bug follow-up
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
binding:web core docs p3
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
RunanywhereAI/runanywhere-sdks#1123 ·
Maintainers usually reply within 1 day
-
StepExamBenchmarkTest runs a loop and prints a timing but asserts nothingPossibly taken A pull request linked to this issue is open or already merged. Openjules
Difficulty 1/5 Under an hour Newbie friendliness 82/100
open-learning-exchange/myplanet#18199 · 1 comment ·
Maintainers usually reply within 4 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
auth0/Auth0.Android#1095 · 1 comment ·
Maintainers usually reply within 1 day
-
Scheme-less stream URLs throw NullPointerException instead of URISyntaxExceptionPossibly taken @blihio claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
pedroSG94/RootEncoder#2218 ·
Maintainers usually reply within 3 days