1
0
mirror of https://github.com/square/okhttp.git synced 2025-11-29 06:23:09 +03:00

Fix source compatibility for some Kotlin callsites. (#4887)

We had a problem where boolean vals needed to be reverted back to
boolean funs. I'd like to go back to vals later, but supporting existing
source patterns is more important.

We also had a problem where single abstract method types (SAM types)
could be supplied as lambas when calling into Java but not when calling
into Kotlin.

I found these by pointing KotlinSourceCompatibilityTest at the OkHttp

Get there like this:
  git co 7eb897ab2e223632b3316bf46a15d37307a3d3b6^
  git co 7eb897ab2e okhttp/build.gradle
  git co 7eb897ab2e build.gradle
This commit is contained in:
Jesse Wilson
2019-04-06 02:07:11 -04:00
committed by Yuri Schimke
parent 2e4191164f
commit 18f2b5e6e6
11 changed files with 103 additions and 22 deletions

View File

@@ -183,7 +183,7 @@ class HttpLoggingInterceptor @JvmOverloads constructor(
logger.log("--> END ${request.method()}")
} else if (bodyHasUnknownEncoding(request.headers())) {
logger.log("--> END ${request.method()} (encoded body omitted)")
} else if (requestBody.isDuplex) {
} else if (requestBody.isDuplex()) {
logger.log("--> END ${request.method()} (duplex request body omitted)")
} else {
val buffer = Buffer()