This is the only behavior change in the PR. The rest is converting
a test from Java to Kotlin (so it can see this internal member) and
getting a TaskRunner instance into the ExchangeFinder, hopefully
useful for implementing Happy Eyeballs.
Also fix up some formatting problems.
Also migrate some tests that use these Util functions from Java to Kotlin.
If we're going to make OkHttp multiplatform, our tests need to be Kotlin
so we can run them on all supported platforms.
I attempted to do a literal translation as much as possible.
Subprojects now need plugins to be configured directly so they
can use the appropriate syntax.
Previously we did a reverse DNS lookup. But the correct strategy
is to look at the inbound ':authority' (HTTP/2) or 'Host' (HTTP/1)
header.
See: https://github.com/square/okhttp/pull/6774
Also rename okhttp3.mockwebserverwrapper to okhttp3.mockwebserver
Directories are not renamed to minimize the git diff. That'll follow
in a separate commit.
Most users of the API are not impacted. The ones that are:
- CallTest subclasses QueueDispatcher
- DuplexTest uses duplex APIs
- HttpOverHttp2Test subclasses QueueDispatcher
This is part 2 of the plan described here:
https://github.com/square/okhttp/pull/6326
Allow for container usage where libraries/plugins may use OkHttp internally and it's not clear who cleans up. This brings HTTP/2 inline with the daemon only behaviour of HTTP/1.1.
This removes a bunch of low-value stuff from the pom.xml files:
- name
- description
- licence distribution ('repo')
- developers clause
- test dependencies
I don't think any of this will be missed, and it shrinks the pom.xml
file to the minimal set of useful stuff.
This also causes us to publish a gradle .module file. This is the
motivation for this change. It'll allow us to ship a Gradle platform,
which is a more capable than a Maven BOM.
The new ktlint sorts imports which makes this diff large.
The new japicmp ignores 'final' modifier changes in final classes.
We adopt the Google style for checkstyle.xml.
Okio readByteString() now uses segments more aggressively, so we
need to mitigate that to avoid tracking those segments in a test.