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

15 Commits

Author SHA1 Message Date
Jesse Wilson
20cd3a0893 Increase severity of bridge methods to ERROR. (#5160)
Delete the KotlinSourceCompatibilityTest. It has served its purpose.
2019-06-03 06:38:19 +01:00
Jesse Wilson
6b537e2585 Remove most of the SAM bridges
The ReplaceWith() on these doesn't work well.

For interceptors I expect the need to be common enough that I'm making these
new APIs that we'll keep going forward. This is for both creating interceptors
directly and as arguments to addInterceptor() and addNetworkInterceptor().
2019-06-02 11:28:53 -04:00
Jesse Wilson
6b30649e6e Deprecate SAM conversion methods 2019-06-01 18:15:36 -04:00
Jesse Wilson
053b6f1544 Adopt idiomatic Kotlin in HttpLoggingInterceptor 2019-05-30 19:29:35 -04:00
Masaru Nomura
7ad4f970ba Idiomatic Kotlin for Response.kt
- define `@get:JvmName(...)` for the following vals in constructor instead of passing `builder: Builder`.
  - `request: Request`
  - `protocol: Protocol`
  - `message: String`
  - `code: Int`
  - `handshake: Handshake?`
  - `headers: Headers`
  - `body: ResponseBody?`
  - `networkResponse: Response?`
  - `cacheResponse: Response?`
  - `priorResponse: Response?`
  - `sentRequestAtMillis: Long`
  - `receivedResponseAtMillis: Long`
  - `exchange: Exchange?`

- add `@Deprecated(...)` to the following functions.
  - `fun request(): Request`
  - `fun protocol(): Protocol`
  - `fun message(): String`
  - `fun code(): Int`
  - `fun handshake(): Handshake?`
  - `fun headers(): Headers`
  - `fun body(): ResponseBody?`
  - `fun networkResponse(): Response?`
  - `fun cacheResponse(): Response?`
  - `fun priorResponse(): Response?`
  - `fun sentRequestAtMillis(): Long`
  - `fun receivedResponseAtMillis(): Long`
  - `fun cacheControl(): CacheControl`

- clean up code where `()`(parentheses) is unnecessarily used.
2019-05-24 16:16:29 -04:00
Jesse Wilson
030dbeae26 Delete unwanted whitespace.
I think the convert-to-Kotlin feature adds these
2019-05-22 21:12:55 -04:00
monkey-mas
fa9118949e Use idiomatic Kotlin in Request.kt (#5092)
- define @get:JvmName(...) for the following vals in constructor instead of passing builder: Builder.
  - url: HttpUrl
  - method: String
  - headers: Headers
  - body: RequestBody?

- add @Deprecated(...) to the following functions.
  - fun url(): HttpUrl
  - fun method(): String
  - fun headers(): Headers
  - fun body(): RequestBody?
  - fun cacheControl(): CacheControl

- clean up code where ()(Parentheses) is unnecessarily used.
2019-05-22 15:55:00 -04:00
Jake Wharton
8d9b408b57 Kotlin improvements
Around string index/substring/contains and collection contains mostly.
2019-05-20 17:13:24 -04:00
Yuri Schimke
f468cfc7b2 Avoiding direct java.lang usage (#5065)
* i

* i

* i
2019-05-18 06:44:20 -04:00
Jesse Wilson
53e0f9e7fb Adopt idiomatic Kotlin in Headers 2019-05-16 08:32:31 -04:00
Jesse Wilson
b46f891a52 Convert HttpHeaders to Kotlin (#5016)
* Rename HttpHeaders.java to .kt

* Convert HttpHeaders to Kotlin
2019-05-06 20:50:19 -04:00
Yuri Schimke
f3949c23bc Spotless code formatter 2019-04-10 22:44:58 +01:00
Jesse Wilson
2e947a2202 Cover more of the OkHttp API for source compatibility 2019-04-06 20:58:08 -04:00
Jesse Wilson
18f2b5e6e6 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
2019-04-06 07:07:11 +01:00
Yuri Schimke
02914fbba1 Kotlin version of logging-interceptor (#4820) 2019-03-30 22:22:28 +00:00