https://kotlinlang.org logo
#android
Title
# android
s

sidharthanil

06/21/2017, 7:58 AM
But when I tried to convert it looked like ``` val httpClient = OkHttpClient.Builder() httpClient.addInterceptor(object : Interceptor() { @Throws(IOException::class) fun intercept(chain: Interceptor.Chain): Response { val original = chain.request() // Request customization: add request headers val requestBuilder = original.newBuilder() .addHeader("Cache-Control", "no-cache") .addHeader("Cache-Control", "no-store") val request = requestBuilder.build() return chain.proceed(request) } }) val client = httpClient.build()
g

gildor

06/21/2017, 8:04 AM
sidharthanil:It's still valid code. Not sure why auto converter do not replace it with lambda. On 1.1.3-eap-85 code converter works well for such case and even replace anonymous class with lambda