From 8fe7577780a8401d1906c0df4e425b247df29dee Mon Sep 17 00:00:00 2001 From: Aaron He Date: Fri, 15 Jun 2018 21:06:57 -0700 Subject: [PATCH] Update build tools * Gradle 4.8 * Android Gradle plugin 3.1.3 * Ktlint Gradle plugin 4.0.0 * Ktlint 0.23.1 --- build.gradle | 16 +++++----------- demo/build.gradle | 3 +-- .../app/echo/domain/AuthStatusRepository.kt | 1 - .../tinder/app/echo/domain/LoggedInLifecycle.kt | 1 - .../tinder/app/echo/inject/EchoBotComponent.kt | 1 - .../tinder/app/gdax/domain/TransactionBook.kt | 1 - .../app/gdax/domain/TransactionRepository.kt | 1 - .../com/tinder/app/gdax/inject/GdaxComponent.kt | 1 - .../com/tinder/app/gdax/target/GdaxTarget.kt | 1 - .../tinder/app/root/ScarletDemoApplication.kt | 1 - .../com/tinder/app/root/inject/CommonModule.kt | 1 - .../com/tinder/app/root/inject/StethoModule.kt | 1 - gradle/wrapper/gradle-wrapper.properties | 2 +- .../tinder/scarlet/utils/FlowableStreamTest.kt | 1 - .../main/java/com/tinder/scarlet/Lifecycle.kt | 1 - .../src/main/java/com/tinder/scarlet/Stream.kt | 1 - .../java/com/tinder/scarlet/StreamAdapter.kt | 1 - .../main/java/com/tinder/scarlet/WebSocket.kt | 1 - .../com/tinder/scarlet/utils/TypeUtilsTest.kt | 3 --- .../builtin/BuiltInMessageAdapterFactory.kt | 1 - .../builtin/ByteArrayMessageAdapter.kt | 1 - .../messageadapter/builtin/TextMessageAdapter.kt | 1 - .../builtin/BuiltInMessageAdapterFactoryTest.kt | 1 - .../builtin/ByteArrayMessageAdapterTest.kt | 1 - .../builtin/TextMessageAdapterTest.kt | 1 - .../messageadapter/gson/GsonMessageAdapter.kt | 1 - .../gson/GsonMessageAdapterTest.kt | 9 +++------ .../messageadapter/moshi/MoshiMessageAdapter.kt | 1 - .../moshi/MoshiMessageAdapterTest.kt | 5 ++--- .../protobuf/ProtobufMessageAdapterTest.kt | 1 - .../builtin/BuiltInStreamAdapterFactory.kt | 1 - .../builtin/IdentityStreamAdapter.kt | 1 - .../builtin/BuiltInStreamAdapterFactoryTest.kt | 1 - .../builtin/IdentityStreamAdapterTest.kt | 1 - .../rxjava/ObservableStreamAdapter.kt | 1 - .../rxjava/RxJavaStreamAdapterFactory.kt | 1 - .../rxjava2/FlowableStreamAdapter.kt | 1 - .../rxjava2/ObservableStreamAdapter.kt | 1 - .../streamadapter/rxjava2/ObservableTest.kt | 1 - ...ServerOkHttpWebSocketConnectionEstablisher.kt | 1 - .../mockwebserver/MockWebServerUtils.kt | 1 - ...OkHttpClientWebSocketConnectionEstablisher.kt | 1 - .../okhttp/OkHttpWebSocketEventObserver.kt | 1 - .../okhttp/request/StaticUrlRequestFactory.kt | 1 - .../okhttp/OkHttpWebSocketEventObserverTest.kt | 1 - .../okhttp/OkHttpWebSocketIntegrationTest.kt | 1 - .../websocket/okhttp/OkHttpWebSocketTest.kt | 1 - .../request/StaticUrlRequestFactoryTest.kt | 1 - .../src/main/java/com/tinder/scarlet/Scarlet.kt | 1 - .../scarlet/internal/connection/Connection.kt | 1 - .../internal/servicemethod/EventMapper.kt | 4 ++-- .../internal/servicemethod/ServiceMethod.kt | 1 - .../servicemethod/ServiceMethodExecutor.kt | 1 - .../servicemethod/StreamAdapterResolver.kt | 1 - .../scarlet/internal/utils/RuntimePlatform.kt | 10 ++++++++-- .../tinder/scarlet/lifecycle/DefaultLifecycle.kt | 1 - .../scarlet/lifecycle/FlowableLifecycle.kt | 1 - .../scarlet/lifecycle/LifecycleRegistry.kt | 1 - .../scarlet/retry/ExponentialBackoffStrategy.kt | 1 - .../ExponentialWithJitterBackoffStrategy.kt | 1 - .../scarlet/retry/LinearBackoffStrategy.kt | 1 - .../internal/connection/ConnectionFactoryTest.kt | 1 - .../internal/connection/ConnectionTest.kt | 1 - .../connection/LifecycleStateSubscriberTest.kt | 1 - .../connection/WebSocketEventSubscriberTest.kt | 1 - .../internal/servicemethod/EventMapperTest.kt | 1 - .../servicemethod/MessageAdapterResolverTest.kt | 1 - .../ReceiveServiceMethodFactoryTest.kt | 1 - .../servicemethod/ReceiveServiceMethodTest.kt | 1 - .../SendServiceMethodFactoryTest.kt | 1 - .../ServiceMethodExecutorFactoryTest.kt | 1 - .../servicemethod/ServiceMethodExecutorTest.kt | 1 - .../scarlet/lifecycle/DefaultLifecycleTest.kt | 1 - .../scarlet/lifecycle/FlowableLifecycleTest.kt | 1 - .../scarlet/lifecycle/LifecycleRegistryTest.kt | 1 - .../retry/ExponentialBackoffStrategyTest.kt | 1 - ...entialBackoffWithJitterBackoffStrategyTest.kt | 6 ++++-- .../java/com/tinder/statemachine/StateMachine.kt | 2 -- 78 files changed, 26 insertions(+), 102 deletions(-) diff --git a/build.gradle b/build.gradle index 55115d54..968d6076 100644 --- a/build.gradle +++ b/build.gradle @@ -8,7 +8,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:3.0.1' + classpath 'com.android.tools.build:gradle:3.1.3' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.5.4" classpath "org.jetbrains.dokka:dokka-gradle-plugin:${dokka_version}" @@ -18,28 +18,22 @@ buildscript { } plugins { - id 'org.jlleitschuh.gradle.ktlint' version '2.2.0' + id 'org.jlleitschuh.gradle.ktlint' version '4.0.0' } ktlint { - version = '0.9.2' + version = '0.23.1' } -allprojects { +subprojects { apply plugin: 'org.kordamp.gradle.stats' apply plugin: "com.jfrog.artifactory" group = 'com.tinder.scarlet' repositories { - mavenCentral() - maven { url "https://jitpack.io" } google() jcenter() } } -clean { - delete rootProject.buildDir -} - -apply from: rootProject.file('dependencies.gradle') +apply from: rootProject.file('dependencies.gradle') \ No newline at end of file diff --git a/demo/build.gradle b/demo/build.gradle index 80d62a25..cad1f91e 100755 --- a/demo/build.gradle +++ b/demo/build.gradle @@ -3,8 +3,7 @@ apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' repositories { - mavenCentral() - google() + maven { url 'https://jitpack.io' } } android { diff --git a/demo/src/main/java/com/tinder/app/echo/domain/AuthStatusRepository.kt b/demo/src/main/java/com/tinder/app/echo/domain/AuthStatusRepository.kt index e9bb4575..7cda98a2 100644 --- a/demo/src/main/java/com/tinder/app/echo/domain/AuthStatusRepository.kt +++ b/demo/src/main/java/com/tinder/app/echo/domain/AuthStatusRepository.kt @@ -19,5 +19,4 @@ class AuthStatusRepository @Inject constructor() { fun observeAuthStatus(): Flowable = authStatusProcessor fun updateAuthStatus(authStatus: AuthStatus) = authStatusProcessor.onNext(authStatus) - } diff --git a/demo/src/main/java/com/tinder/app/echo/domain/LoggedInLifecycle.kt b/demo/src/main/java/com/tinder/app/echo/domain/LoggedInLifecycle.kt index 836add9d..a9d6d134 100644 --- a/demo/src/main/java/com/tinder/app/echo/domain/LoggedInLifecycle.kt +++ b/demo/src/main/java/com/tinder/app/echo/domain/LoggedInLifecycle.kt @@ -27,5 +27,4 @@ class LoggedInLifecycle constructor( } .subscribe(lifecycleRegistry) } - } diff --git a/demo/src/main/java/com/tinder/app/echo/inject/EchoBotComponent.kt b/demo/src/main/java/com/tinder/app/echo/inject/EchoBotComponent.kt index 90628a29..fe3d97e6 100644 --- a/demo/src/main/java/com/tinder/app/echo/inject/EchoBotComponent.kt +++ b/demo/src/main/java/com/tinder/app/echo/inject/EchoBotComponent.kt @@ -67,5 +67,4 @@ interface EchoBotComponent { interface ComponentProvider { val echoBotComponent: EchoBotComponent } - } diff --git a/demo/src/main/java/com/tinder/app/gdax/domain/TransactionBook.kt b/demo/src/main/java/com/tinder/app/gdax/domain/TransactionBook.kt index f38a64c4..54460ebf 100644 --- a/demo/src/main/java/com/tinder/app/gdax/domain/TransactionBook.kt +++ b/demo/src/main/java/com/tinder/app/gdax/domain/TransactionBook.kt @@ -16,5 +16,4 @@ class TransactionBook( newHistory.transactions[product] = (newHistory.transactions[product] ?: emptyList()) + transaction return newHistory } - } diff --git a/demo/src/main/java/com/tinder/app/gdax/domain/TransactionRepository.kt b/demo/src/main/java/com/tinder/app/gdax/domain/TransactionRepository.kt index 5e951fc0..3773379d 100644 --- a/demo/src/main/java/com/tinder/app/gdax/domain/TransactionRepository.kt +++ b/demo/src/main/java/com/tinder/app/gdax/domain/TransactionRepository.kt @@ -68,5 +68,4 @@ class TransactionRepository @Inject constructor( transactionBookRef.set(transactionBook) transactionBookProcessor.onNext(transactionBook) } - } diff --git a/demo/src/main/java/com/tinder/app/gdax/inject/GdaxComponent.kt b/demo/src/main/java/com/tinder/app/gdax/inject/GdaxComponent.kt index 450eac32..b74b2f4c 100644 --- a/demo/src/main/java/com/tinder/app/gdax/inject/GdaxComponent.kt +++ b/demo/src/main/java/com/tinder/app/gdax/inject/GdaxComponent.kt @@ -73,5 +73,4 @@ interface GdaxComponent { interface ComponentProvider { val gdaxComponent: GdaxComponent } - } diff --git a/demo/src/main/java/com/tinder/app/gdax/target/GdaxTarget.kt b/demo/src/main/java/com/tinder/app/gdax/target/GdaxTarget.kt index dcdb599b..1517452c 100644 --- a/demo/src/main/java/com/tinder/app/gdax/target/GdaxTarget.kt +++ b/demo/src/main/java/com/tinder/app/gdax/target/GdaxTarget.kt @@ -10,5 +10,4 @@ import com.tinder.app.gdax.domain.Transaction interface GdaxTarget { fun showTransactions(product: Product, transactions: List) - } diff --git a/demo/src/main/java/com/tinder/app/root/ScarletDemoApplication.kt b/demo/src/main/java/com/tinder/app/root/ScarletDemoApplication.kt index 5d24cd2c..47e16ced 100755 --- a/demo/src/main/java/com/tinder/app/root/ScarletDemoApplication.kt +++ b/demo/src/main/java/com/tinder/app/root/ScarletDemoApplication.kt @@ -46,5 +46,4 @@ class ScarletDemoApplication : Application(), Timber.plant(Timber.DebugTree()) Stetho.initialize(stethoInitializer) } - } diff --git a/demo/src/main/java/com/tinder/app/root/inject/CommonModule.kt b/demo/src/main/java/com/tinder/app/root/inject/CommonModule.kt index 4827a727..f965f563 100755 --- a/demo/src/main/java/com/tinder/app/root/inject/CommonModule.kt +++ b/demo/src/main/java/com/tinder/app/root/inject/CommonModule.kt @@ -16,5 +16,4 @@ class CommonModule { fun provideApplicationContext(application: Application): Context { return application } - } diff --git a/demo/src/main/java/com/tinder/app/root/inject/StethoModule.kt b/demo/src/main/java/com/tinder/app/root/inject/StethoModule.kt index ef0b0f42..9223979e 100755 --- a/demo/src/main/java/com/tinder/app/root/inject/StethoModule.kt +++ b/demo/src/main/java/com/tinder/app/root/inject/StethoModule.kt @@ -43,5 +43,4 @@ class StethoModule { internal fun provideInspectorModulesProvider(application: Application): InspectorModulesProvider { return Stetho.defaultInspectorModulesProvider(application) } - } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index f8d6248b..1b3c553d 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.8-all.zip diff --git a/scarlet-core-internal/src/test/java/com/tinder/scarlet/utils/FlowableStreamTest.kt b/scarlet-core-internal/src/test/java/com/tinder/scarlet/utils/FlowableStreamTest.kt index 7f4e2b71..776e7dc1 100644 --- a/scarlet-core-internal/src/test/java/com/tinder/scarlet/utils/FlowableStreamTest.kt +++ b/scarlet-core-internal/src/test/java/com/tinder/scarlet/utils/FlowableStreamTest.kt @@ -71,5 +71,4 @@ internal class FlowableStreamTest { // Then assertThat(processor.hasSubscribers()).isFalse() } - } diff --git a/scarlet-core/src/main/java/com/tinder/scarlet/Lifecycle.kt b/scarlet-core/src/main/java/com/tinder/scarlet/Lifecycle.kt index c0952d95..5e12311b 100644 --- a/scarlet-core/src/main/java/com/tinder/scarlet/Lifecycle.kt +++ b/scarlet-core/src/main/java/com/tinder/scarlet/Lifecycle.kt @@ -45,4 +45,3 @@ interface Lifecycle : Publisher { object Destroyed : State() } } - diff --git a/scarlet-core/src/main/java/com/tinder/scarlet/Stream.kt b/scarlet-core/src/main/java/com/tinder/scarlet/Stream.kt index ea206e1d..b3a16d60 100644 --- a/scarlet-core/src/main/java/com/tinder/scarlet/Stream.kt +++ b/scarlet-core/src/main/java/com/tinder/scarlet/Stream.kt @@ -40,5 +40,4 @@ interface Stream : Publisher { fun isDisposed(): Boolean } - } diff --git a/scarlet-core/src/main/java/com/tinder/scarlet/StreamAdapter.kt b/scarlet-core/src/main/java/com/tinder/scarlet/StreamAdapter.kt index ca128731..270a02eb 100644 --- a/scarlet-core/src/main/java/com/tinder/scarlet/StreamAdapter.kt +++ b/scarlet-core/src/main/java/com/tinder/scarlet/StreamAdapter.kt @@ -28,6 +28,5 @@ interface StreamAdapter { * handled by this factory. */ fun create(type: Type): StreamAdapter - } } diff --git a/scarlet-core/src/main/java/com/tinder/scarlet/WebSocket.kt b/scarlet-core/src/main/java/com/tinder/scarlet/WebSocket.kt index 40103adb..eabe896f 100644 --- a/scarlet-core/src/main/java/com/tinder/scarlet/WebSocket.kt +++ b/scarlet-core/src/main/java/com/tinder/scarlet/WebSocket.kt @@ -79,5 +79,4 @@ interface WebSocket { interface Factory { fun create(): WebSocket } - } diff --git a/scarlet-core/src/test/java/com/tinder/scarlet/utils/TypeUtilsTest.kt b/scarlet-core/src/test/java/com/tinder/scarlet/utils/TypeUtilsTest.kt index 7c987af4..4b4b7194 100644 --- a/scarlet-core/src/test/java/com/tinder/scarlet/utils/TypeUtilsTest.kt +++ b/scarlet-core/src/test/java/com/tinder/scarlet/utils/TypeUtilsTest.kt @@ -70,7 +70,6 @@ internal class TypeUtilsTest { private fun param(type: Type, expectedHasUnresolvableType: Boolean) = arrayOf(type, expectedHasUnresolvableType) } - } @RunWith(Parameterized::class) @@ -102,7 +101,6 @@ internal class TypeUtilsTest { private fun param(type: ParameterizedType, expectedParameterUpperBound: Array) = arrayOf(type, expectedParameterUpperBound) } - } private companion object { @@ -146,5 +144,4 @@ internal class TypeUtilsTest { } } } - } diff --git a/scarlet-message-adapter-builtin/src/main/java/com/tinder/scarlet/messageadapter/builtin/BuiltInMessageAdapterFactory.kt b/scarlet-message-adapter-builtin/src/main/java/com/tinder/scarlet/messageadapter/builtin/BuiltInMessageAdapterFactory.kt index 396ad2b2..8d66a01a 100644 --- a/scarlet-message-adapter-builtin/src/main/java/com/tinder/scarlet/messageadapter/builtin/BuiltInMessageAdapterFactory.kt +++ b/scarlet-message-adapter-builtin/src/main/java/com/tinder/scarlet/messageadapter/builtin/BuiltInMessageAdapterFactory.kt @@ -15,5 +15,4 @@ class BuiltInMessageAdapterFactory : MessageAdapter.Factory { ByteArray::class.java -> ByteArrayMessageAdapter() else -> throw IllegalArgumentException("Type is not supported by this MessageAdapterFactory: $type") } - } diff --git a/scarlet-message-adapter-builtin/src/main/java/com/tinder/scarlet/messageadapter/builtin/ByteArrayMessageAdapter.kt b/scarlet-message-adapter-builtin/src/main/java/com/tinder/scarlet/messageadapter/builtin/ByteArrayMessageAdapter.kt index 30a93d12..e09746e7 100644 --- a/scarlet-message-adapter-builtin/src/main/java/com/tinder/scarlet/messageadapter/builtin/ByteArrayMessageAdapter.kt +++ b/scarlet-message-adapter-builtin/src/main/java/com/tinder/scarlet/messageadapter/builtin/ByteArrayMessageAdapter.kt @@ -15,5 +15,4 @@ class ByteArrayMessageAdapter : MessageAdapter { } override fun toMessage(data: ByteArray): Message = Message.Bytes(data) - } diff --git a/scarlet-message-adapter-builtin/src/main/java/com/tinder/scarlet/messageadapter/builtin/TextMessageAdapter.kt b/scarlet-message-adapter-builtin/src/main/java/com/tinder/scarlet/messageadapter/builtin/TextMessageAdapter.kt index 7d3f060e..ed2fa782 100644 --- a/scarlet-message-adapter-builtin/src/main/java/com/tinder/scarlet/messageadapter/builtin/TextMessageAdapter.kt +++ b/scarlet-message-adapter-builtin/src/main/java/com/tinder/scarlet/messageadapter/builtin/TextMessageAdapter.kt @@ -15,5 +15,4 @@ class TextMessageAdapter : MessageAdapter { } override fun toMessage(data: String): Message = Message.Text(data) - } diff --git a/scarlet-message-adapter-builtin/src/test/java/com/tinder/scarlet/messageadapter/builtin/BuiltInMessageAdapterFactoryTest.kt b/scarlet-message-adapter-builtin/src/test/java/com/tinder/scarlet/messageadapter/builtin/BuiltInMessageAdapterFactoryTest.kt index 63aee894..0451ca7e 100644 --- a/scarlet-message-adapter-builtin/src/test/java/com/tinder/scarlet/messageadapter/builtin/BuiltInMessageAdapterFactoryTest.kt +++ b/scarlet-message-adapter-builtin/src/test/java/com/tinder/scarlet/messageadapter/builtin/BuiltInMessageAdapterFactoryTest.kt @@ -51,5 +51,4 @@ internal class BuiltInMessageAdapterFactoryTest { Collection::class.java ) } - } diff --git a/scarlet-message-adapter-builtin/src/test/java/com/tinder/scarlet/messageadapter/builtin/ByteArrayMessageAdapterTest.kt b/scarlet-message-adapter-builtin/src/test/java/com/tinder/scarlet/messageadapter/builtin/ByteArrayMessageAdapterTest.kt index 62d16694..1b36339e 100644 --- a/scarlet-message-adapter-builtin/src/test/java/com/tinder/scarlet/messageadapter/builtin/ByteArrayMessageAdapterTest.kt +++ b/scarlet-message-adapter-builtin/src/test/java/com/tinder/scarlet/messageadapter/builtin/ByteArrayMessageAdapterTest.kt @@ -38,5 +38,4 @@ internal class ByteArrayMessageAdapterTest { val (adaptedBytes) = (adaptedMessage as Message.Bytes) assertThat(adaptedBytes).isEqualTo(bytes) } - } diff --git a/scarlet-message-adapter-builtin/src/test/java/com/tinder/scarlet/messageadapter/builtin/TextMessageAdapterTest.kt b/scarlet-message-adapter-builtin/src/test/java/com/tinder/scarlet/messageadapter/builtin/TextMessageAdapterTest.kt index 89b7512c..28577d35 100644 --- a/scarlet-message-adapter-builtin/src/test/java/com/tinder/scarlet/messageadapter/builtin/TextMessageAdapterTest.kt +++ b/scarlet-message-adapter-builtin/src/test/java/com/tinder/scarlet/messageadapter/builtin/TextMessageAdapterTest.kt @@ -37,5 +37,4 @@ internal class TextMessageAdapterTest { // Then assertThat(adaptedMessage).isEqualTo(textMessage) } - } diff --git a/scarlet-message-adapter-gson/src/main/java/com/tinder/scarlet/messageadapter/gson/GsonMessageAdapter.kt b/scarlet-message-adapter-gson/src/main/java/com/tinder/scarlet/messageadapter/gson/GsonMessageAdapter.kt index 5c9346f0..592377c7 100644 --- a/scarlet-message-adapter-gson/src/main/java/com/tinder/scarlet/messageadapter/gson/GsonMessageAdapter.kt +++ b/scarlet-message-adapter-gson/src/main/java/com/tinder/scarlet/messageadapter/gson/GsonMessageAdapter.kt @@ -55,5 +55,4 @@ class GsonMessageAdapter private constructor( private val DEFAULT_GSON = Gson() } } - } diff --git a/scarlet-message-adapter-gson/src/test/java/com/tinder/scarlet/messageadapter/gson/GsonMessageAdapterTest.kt b/scarlet-message-adapter-gson/src/test/java/com/tinder/scarlet/messageadapter/gson/GsonMessageAdapterTest.kt index 526c8fad..a53bc991 100644 --- a/scarlet-message-adapter-gson/src/test/java/com/tinder/scarlet/messageadapter/gson/GsonMessageAdapterTest.kt +++ b/scarlet-message-adapter-gson/src/test/java/com/tinder/scarlet/messageadapter/gson/GsonMessageAdapterTest.kt @@ -10,17 +10,17 @@ import com.google.gson.TypeAdapter import com.google.gson.stream.JsonReader import com.google.gson.stream.JsonToken import com.google.gson.stream.JsonWriter -import com.tinder.scarlet.WebSocket.Event +import com.tinder.scarlet.Lifecycle import com.tinder.scarlet.Message import com.tinder.scarlet.MessageAdapter import com.tinder.scarlet.Scarlet import com.tinder.scarlet.Stream -import com.tinder.scarlet.Lifecycle +import com.tinder.scarlet.WebSocket.Event import com.tinder.scarlet.lifecycle.LifecycleRegistry import com.tinder.scarlet.testutils.TestStreamObserver +import com.tinder.scarlet.testutils.any import com.tinder.scarlet.testutils.containingText import com.tinder.scarlet.testutils.test -import com.tinder.scarlet.testutils.any import com.tinder.scarlet.websocket.mockwebserver.newWebSocketFactory import com.tinder.scarlet.websocket.okhttp.newWebSocketFactory import com.tinder.scarlet.ws.Receive @@ -225,7 +225,6 @@ internal class GsonMessageAdapterTest { else -> throw IllegalArgumentException("$type is not supported.") } } - } internal interface Service { @@ -244,7 +243,5 @@ internal class GsonMessageAdapterTest { @Send fun sendAnInterface(impl: AnInterface): Boolean } - } - } diff --git a/scarlet-message-adapter-moshi/src/main/java/com/tinder/scarlet/messageadapter/moshi/MoshiMessageAdapter.kt b/scarlet-message-adapter-moshi/src/main/java/com/tinder/scarlet/messageadapter/moshi/MoshiMessageAdapter.kt index e3224f2e..fadded0b 100755 --- a/scarlet-message-adapter-moshi/src/main/java/com/tinder/scarlet/messageadapter/moshi/MoshiMessageAdapter.kt +++ b/scarlet-message-adapter-moshi/src/main/java/com/tinder/scarlet/messageadapter/moshi/MoshiMessageAdapter.kt @@ -83,7 +83,6 @@ class MoshiMessageAdapter private constructor( val serializeNull: Boolean = false, val failOnUnknown: Boolean = false ) - } private companion object { diff --git a/scarlet-message-adapter-moshi/src/test/java/com/tinder/scarlet/messageadapter/moshi/MoshiMessageAdapterTest.kt b/scarlet-message-adapter-moshi/src/test/java/com/tinder/scarlet/messageadapter/moshi/MoshiMessageAdapterTest.kt index eec8a633..107e1040 100644 --- a/scarlet-message-adapter-moshi/src/test/java/com/tinder/scarlet/messageadapter/moshi/MoshiMessageAdapterTest.kt +++ b/scarlet-message-adapter-moshi/src/test/java/com/tinder/scarlet/messageadapter/moshi/MoshiMessageAdapterTest.kt @@ -302,7 +302,8 @@ internal class MoshiMessageAdapterTest { class VerifyJsonQualifierJsonAdapterFactory : JsonAdapter.Factory { override fun create( - type: Type, annotations: Set, + type: Type, + annotations: Set, moshi: Moshi ): JsonAdapter<*>? { for (annotation in annotations) { @@ -381,7 +382,5 @@ internal class MoshiMessageAdapterTest { @NonQualifer fun observeAnnotatedString(): Stream } - } - } diff --git a/scarlet-message-adapter-protobuf/src/test/java/com/tinder/scarlet/messageadapter/protobuf/ProtobufMessageAdapterTest.kt b/scarlet-message-adapter-protobuf/src/test/java/com/tinder/scarlet/messageadapter/protobuf/ProtobufMessageAdapterTest.kt index db627554..fece9868 100644 --- a/scarlet-message-adapter-protobuf/src/test/java/com/tinder/scarlet/messageadapter/protobuf/ProtobufMessageAdapterTest.kt +++ b/scarlet-message-adapter-protobuf/src/test/java/com/tinder/scarlet/messageadapter/protobuf/ProtobufMessageAdapterTest.kt @@ -218,6 +218,5 @@ internal class ProtobufMessageAdapterTest { @Receive fun receiveWrongClassDeserialization(): Stream> } - } } diff --git a/scarlet-stream-adapter-builtin/src/main/java/com/tinder/scarlet/streamadapter/builtin/BuiltInStreamAdapterFactory.kt b/scarlet-stream-adapter-builtin/src/main/java/com/tinder/scarlet/streamadapter/builtin/BuiltInStreamAdapterFactory.kt index 559bffdd..40248412 100644 --- a/scarlet-stream-adapter-builtin/src/main/java/com/tinder/scarlet/streamadapter/builtin/BuiltInStreamAdapterFactory.kt +++ b/scarlet-stream-adapter-builtin/src/main/java/com/tinder/scarlet/streamadapter/builtin/BuiltInStreamAdapterFactory.kt @@ -15,5 +15,4 @@ class BuiltInStreamAdapterFactory : StreamAdapter.Factory { Stream::class.java -> IdentityStreamAdapter() else -> throw IllegalArgumentException("$type is not supported.") } - } diff --git a/scarlet-stream-adapter-builtin/src/main/java/com/tinder/scarlet/streamadapter/builtin/IdentityStreamAdapter.kt b/scarlet-stream-adapter-builtin/src/main/java/com/tinder/scarlet/streamadapter/builtin/IdentityStreamAdapter.kt index 9aaf8c1a..8306a2d3 100644 --- a/scarlet-stream-adapter-builtin/src/main/java/com/tinder/scarlet/streamadapter/builtin/IdentityStreamAdapter.kt +++ b/scarlet-stream-adapter-builtin/src/main/java/com/tinder/scarlet/streamadapter/builtin/IdentityStreamAdapter.kt @@ -10,5 +10,4 @@ import com.tinder.scarlet.StreamAdapter class IdentityStreamAdapter : StreamAdapter> { override fun adapt(stream: Stream): Stream = stream - } diff --git a/scarlet-stream-adapter-builtin/src/test/java/com/tinder/scarlet/streamadapter/builtin/BuiltInStreamAdapterFactoryTest.kt b/scarlet-stream-adapter-builtin/src/test/java/com/tinder/scarlet/streamadapter/builtin/BuiltInStreamAdapterFactoryTest.kt index 7608f8e0..ed56f455 100644 --- a/scarlet-stream-adapter-builtin/src/test/java/com/tinder/scarlet/streamadapter/builtin/BuiltInStreamAdapterFactoryTest.kt +++ b/scarlet-stream-adapter-builtin/src/test/java/com/tinder/scarlet/streamadapter/builtin/BuiltInStreamAdapterFactoryTest.kt @@ -44,5 +44,4 @@ internal class BuiltInStreamAdapterFactoryTest { Collection::class.java ) } - } diff --git a/scarlet-stream-adapter-builtin/src/test/java/com/tinder/scarlet/streamadapter/builtin/IdentityStreamAdapterTest.kt b/scarlet-stream-adapter-builtin/src/test/java/com/tinder/scarlet/streamadapter/builtin/IdentityStreamAdapterTest.kt index 85e1b0d5..cc513e79 100644 --- a/scarlet-stream-adapter-builtin/src/test/java/com/tinder/scarlet/streamadapter/builtin/IdentityStreamAdapterTest.kt +++ b/scarlet-stream-adapter-builtin/src/test/java/com/tinder/scarlet/streamadapter/builtin/IdentityStreamAdapterTest.kt @@ -24,5 +24,4 @@ internal class IdentityStreamAdapterTest { // Then assertThat(adaptedStream).isSameAs(stream) } - } diff --git a/scarlet-stream-adapter-rxjava/src/main/java/com/tinder/scarlet/streamadapter/rxjava/ObservableStreamAdapter.kt b/scarlet-stream-adapter-rxjava/src/main/java/com/tinder/scarlet/streamadapter/rxjava/ObservableStreamAdapter.kt index 7edb9955..5f660619 100644 --- a/scarlet-stream-adapter-rxjava/src/main/java/com/tinder/scarlet/streamadapter/rxjava/ObservableStreamAdapter.kt +++ b/scarlet-stream-adapter-rxjava/src/main/java/com/tinder/scarlet/streamadapter/rxjava/ObservableStreamAdapter.kt @@ -35,5 +35,4 @@ class ObservableStreamAdapter : StreamAdapter> { } } } - } diff --git a/scarlet-stream-adapter-rxjava/src/main/java/com/tinder/scarlet/streamadapter/rxjava/RxJavaStreamAdapterFactory.kt b/scarlet-stream-adapter-rxjava/src/main/java/com/tinder/scarlet/streamadapter/rxjava/RxJavaStreamAdapterFactory.kt index 83653ce7..86a824ca 100755 --- a/scarlet-stream-adapter-rxjava/src/main/java/com/tinder/scarlet/streamadapter/rxjava/RxJavaStreamAdapterFactory.kt +++ b/scarlet-stream-adapter-rxjava/src/main/java/com/tinder/scarlet/streamadapter/rxjava/RxJavaStreamAdapterFactory.kt @@ -18,5 +18,4 @@ class RxJavaStreamAdapterFactory : StreamAdapter.Factory { Observable::class.java -> ObservableStreamAdapter() else -> throw IllegalArgumentException() } - } diff --git a/scarlet-stream-adapter-rxjava2/src/main/java/com/tinder/scarlet/streamadapter/rxjava2/FlowableStreamAdapter.kt b/scarlet-stream-adapter-rxjava2/src/main/java/com/tinder/scarlet/streamadapter/rxjava2/FlowableStreamAdapter.kt index 08b9763a..12c2333b 100644 --- a/scarlet-stream-adapter-rxjava2/src/main/java/com/tinder/scarlet/streamadapter/rxjava2/FlowableStreamAdapter.kt +++ b/scarlet-stream-adapter-rxjava2/src/main/java/com/tinder/scarlet/streamadapter/rxjava2/FlowableStreamAdapter.kt @@ -11,5 +11,4 @@ import io.reactivex.Flowable class FlowableStreamAdapter : StreamAdapter> { override fun adapt(stream: Stream): Flowable = Flowable.fromPublisher(stream) - } diff --git a/scarlet-stream-adapter-rxjava2/src/main/java/com/tinder/scarlet/streamadapter/rxjava2/ObservableStreamAdapter.kt b/scarlet-stream-adapter-rxjava2/src/main/java/com/tinder/scarlet/streamadapter/rxjava2/ObservableStreamAdapter.kt index 09f50a77..5fd5b725 100644 --- a/scarlet-stream-adapter-rxjava2/src/main/java/com/tinder/scarlet/streamadapter/rxjava2/ObservableStreamAdapter.kt +++ b/scarlet-stream-adapter-rxjava2/src/main/java/com/tinder/scarlet/streamadapter/rxjava2/ObservableStreamAdapter.kt @@ -11,5 +11,4 @@ import io.reactivex.Observable class ObservableStreamAdapter : StreamAdapter> { override fun adapt(stream: Stream): Observable = Observable.fromPublisher(stream) - } diff --git a/scarlet-stream-adapter-rxjava2/src/test/java/com/tinder/scarlet/streamadapter/rxjava2/ObservableTest.kt b/scarlet-stream-adapter-rxjava2/src/test/java/com/tinder/scarlet/streamadapter/rxjava2/ObservableTest.kt index 28c36566..07d89dc6 100644 --- a/scarlet-stream-adapter-rxjava2/src/test/java/com/tinder/scarlet/streamadapter/rxjava2/ObservableTest.kt +++ b/scarlet-stream-adapter-rxjava2/src/test/java/com/tinder/scarlet/streamadapter/rxjava2/ObservableTest.kt @@ -140,5 +140,4 @@ class ObservableTest { @Send fun sendBytesAndConfirm(message: ByteArray): Boolean } - } diff --git a/scarlet-websocket-mockwebserver/src/main/java/com/tinder/scarlet/websocket/mockwebserver/MockWebServerOkHttpWebSocketConnectionEstablisher.kt b/scarlet-websocket-mockwebserver/src/main/java/com/tinder/scarlet/websocket/mockwebserver/MockWebServerOkHttpWebSocketConnectionEstablisher.kt index bf2bc157..f1f3bd85 100644 --- a/scarlet-websocket-mockwebserver/src/main/java/com/tinder/scarlet/websocket/mockwebserver/MockWebServerOkHttpWebSocketConnectionEstablisher.kt +++ b/scarlet-websocket-mockwebserver/src/main/java/com/tinder/scarlet/websocket/mockwebserver/MockWebServerOkHttpWebSocketConnectionEstablisher.kt @@ -16,5 +16,4 @@ class MockWebServerOkHttpWebSocketConnectionEstablisher( override fun establishConnection(webSocketListener: WebSocketListener) { mockWebServer.enqueue(MockResponse().withWebSocketUpgrade(webSocketListener)) } - } diff --git a/scarlet-websocket-mockwebserver/src/main/java/com/tinder/scarlet/websocket/mockwebserver/MockWebServerUtils.kt b/scarlet-websocket-mockwebserver/src/main/java/com/tinder/scarlet/websocket/mockwebserver/MockWebServerUtils.kt index 9969265e..a89762a3 100644 --- a/scarlet-websocket-mockwebserver/src/main/java/com/tinder/scarlet/websocket/mockwebserver/MockWebServerUtils.kt +++ b/scarlet-websocket-mockwebserver/src/main/java/com/tinder/scarlet/websocket/mockwebserver/MockWebServerUtils.kt @@ -12,4 +12,3 @@ import okhttp3.mockwebserver.MockWebServer fun MockWebServer.newWebSocketFactory(): WebSocket.Factory = OkHttpWebSocket.Factory(MockWebServerOkHttpWebSocketConnectionEstablisher(this)) - diff --git a/scarlet-websocket-okhttp/src/main/java/com/tinder/scarlet/websocket/okhttp/OkHttpClientWebSocketConnectionEstablisher.kt b/scarlet-websocket-okhttp/src/main/java/com/tinder/scarlet/websocket/okhttp/OkHttpClientWebSocketConnectionEstablisher.kt index 5b901b11..69bb565f 100644 --- a/scarlet-websocket-okhttp/src/main/java/com/tinder/scarlet/websocket/okhttp/OkHttpClientWebSocketConnectionEstablisher.kt +++ b/scarlet-websocket-okhttp/src/main/java/com/tinder/scarlet/websocket/okhttp/OkHttpClientWebSocketConnectionEstablisher.kt @@ -17,5 +17,4 @@ class OkHttpClientWebSocketConnectionEstablisher( val request = requestFactory.createRequest() okHttpClient.newWebSocket(request, webSocketListener) } - } diff --git a/scarlet-websocket-okhttp/src/main/java/com/tinder/scarlet/websocket/okhttp/OkHttpWebSocketEventObserver.kt b/scarlet-websocket-okhttp/src/main/java/com/tinder/scarlet/websocket/okhttp/OkHttpWebSocketEventObserver.kt index f2596bdc..cbc5154e 100644 --- a/scarlet-websocket-okhttp/src/main/java/com/tinder/scarlet/websocket/okhttp/OkHttpWebSocketEventObserver.kt +++ b/scarlet-websocket-okhttp/src/main/java/com/tinder/scarlet/websocket/okhttp/OkHttpWebSocketEventObserver.kt @@ -37,5 +37,4 @@ internal class OkHttpWebSocketEventObserver : WebSocketListener() { override fun onFailure(webSocket: okhttp3.WebSocket, t: Throwable, response: Response?) = processor.onNext(WebSocket.Event.OnConnectionFailed(t)) - } diff --git a/scarlet-websocket-okhttp/src/main/java/com/tinder/scarlet/websocket/okhttp/request/StaticUrlRequestFactory.kt b/scarlet-websocket-okhttp/src/main/java/com/tinder/scarlet/websocket/okhttp/request/StaticUrlRequestFactory.kt index a9b80f14..ff0adf5b 100644 --- a/scarlet-websocket-okhttp/src/main/java/com/tinder/scarlet/websocket/okhttp/request/StaticUrlRequestFactory.kt +++ b/scarlet-websocket-okhttp/src/main/java/com/tinder/scarlet/websocket/okhttp/request/StaticUrlRequestFactory.kt @@ -16,5 +16,4 @@ internal class StaticUrlRequestFactory( override fun createRequest(): Request = Request.Builder() .url(url) .build() - } diff --git a/scarlet-websocket-okhttp/src/test/java/com/tinder/scarlet/websocket/okhttp/OkHttpWebSocketEventObserverTest.kt b/scarlet-websocket-okhttp/src/test/java/com/tinder/scarlet/websocket/okhttp/OkHttpWebSocketEventObserverTest.kt index f35d120a..55bf570a 100644 --- a/scarlet-websocket-okhttp/src/test/java/com/tinder/scarlet/websocket/okhttp/OkHttpWebSocketEventObserverTest.kt +++ b/scarlet-websocket-okhttp/src/test/java/com/tinder/scarlet/websocket/okhttp/OkHttpWebSocketEventObserverTest.kt @@ -51,5 +51,4 @@ internal class OkHttpWebSocketEventObserverTest { WebSocket.Event.OnConnectionFailed(throwable) ) } - } diff --git a/scarlet-websocket-okhttp/src/test/java/com/tinder/scarlet/websocket/okhttp/OkHttpWebSocketIntegrationTest.kt b/scarlet-websocket-okhttp/src/test/java/com/tinder/scarlet/websocket/okhttp/OkHttpWebSocketIntegrationTest.kt index 7452591c..6c4c5089 100644 --- a/scarlet-websocket-okhttp/src/test/java/com/tinder/scarlet/websocket/okhttp/OkHttpWebSocketIntegrationTest.kt +++ b/scarlet-websocket-okhttp/src/test/java/com/tinder/scarlet/websocket/okhttp/OkHttpWebSocketIntegrationTest.kt @@ -233,5 +233,4 @@ internal class OkHttpWebSocketIntegrationTest { @Send fun sendBytesAndConfirm(message: ByteArray): Boolean } - } diff --git a/scarlet-websocket-okhttp/src/test/java/com/tinder/scarlet/websocket/okhttp/OkHttpWebSocketTest.kt b/scarlet-websocket-okhttp/src/test/java/com/tinder/scarlet/websocket/okhttp/OkHttpWebSocketTest.kt index 49b60c37..8c43ab7e 100644 --- a/scarlet-websocket-okhttp/src/test/java/com/tinder/scarlet/websocket/okhttp/OkHttpWebSocketTest.kt +++ b/scarlet-websocket-okhttp/src/test/java/com/tinder/scarlet/websocket/okhttp/OkHttpWebSocketTest.kt @@ -180,5 +180,4 @@ internal class OkHttpWebSocketTest { // Then then(webSocketHolder).should().cancel() } - } diff --git a/scarlet-websocket-okhttp/src/test/java/com/tinder/scarlet/websocket/okhttp/request/StaticUrlRequestFactoryTest.kt b/scarlet-websocket-okhttp/src/test/java/com/tinder/scarlet/websocket/okhttp/request/StaticUrlRequestFactoryTest.kt index a1bd9572..6ab17ace 100644 --- a/scarlet-websocket-okhttp/src/test/java/com/tinder/scarlet/websocket/okhttp/request/StaticUrlRequestFactoryTest.kt +++ b/scarlet-websocket-okhttp/src/test/java/com/tinder/scarlet/websocket/okhttp/request/StaticUrlRequestFactoryTest.kt @@ -21,5 +21,4 @@ internal class StaticUrlRequestFactoryTest { // Then assertThat(request1.url()).isEqualTo(request2.url()) } - } diff --git a/scarlet/src/main/java/com/tinder/scarlet/Scarlet.kt b/scarlet/src/main/java/com/tinder/scarlet/Scarlet.kt index dbe5c893..f84a164f 100644 --- a/scarlet/src/main/java/com/tinder/scarlet/Scarlet.kt +++ b/scarlet/src/main/java/com/tinder/scarlet/Scarlet.kt @@ -199,5 +199,4 @@ class Scarlet internal constructor( private val DEFAULT_SCHEDULER = Schedulers.computation() // TODO same thread option for debugging } } - } diff --git a/scarlet/src/main/java/com/tinder/scarlet/internal/connection/Connection.kt b/scarlet/src/main/java/com/tinder/scarlet/internal/connection/Connection.kt index 321667ab..dd61f9d5 100644 --- a/scarlet/src/main/java/com/tinder/scarlet/internal/connection/Connection.kt +++ b/scarlet/src/main/java/com/tinder/scarlet/internal/connection/Connection.kt @@ -218,5 +218,4 @@ internal class Connection( private fun createSharedLifecycle() = LifecycleRegistry() .apply { lifecycle.subscribe(this) } } - } diff --git a/scarlet/src/main/java/com/tinder/scarlet/internal/servicemethod/EventMapper.kt b/scarlet/src/main/java/com/tinder/scarlet/internal/servicemethod/EventMapper.kt index 5a27d25c..233f9ffb 100644 --- a/scarlet/src/main/java/com/tinder/scarlet/internal/servicemethod/EventMapper.kt +++ b/scarlet/src/main/java/com/tinder/scarlet/internal/servicemethod/EventMapper.kt @@ -127,7 +127,8 @@ internal sealed class EventMapper { } private fun resolveMessageAdapter( - returnType: ParameterizedType, annotations: Array + returnType: ParameterizedType, + annotations: Array ): MessageAdapter { val receivingType = returnType.getFirstTypeArgument() val messageType = when (receivingType.getRawType()) { @@ -136,7 +137,6 @@ internal sealed class EventMapper { } return messageAdapterResolver.resolve(messageType, annotations) } - } companion object { diff --git a/scarlet/src/main/java/com/tinder/scarlet/internal/servicemethod/ServiceMethod.kt b/scarlet/src/main/java/com/tinder/scarlet/internal/servicemethod/ServiceMethod.kt index 5fe4a7e6..16dce50a 100644 --- a/scarlet/src/main/java/com/tinder/scarlet/internal/servicemethod/ServiceMethod.kt +++ b/scarlet/src/main/java/com/tinder/scarlet/internal/servicemethod/ServiceMethod.kt @@ -106,5 +106,4 @@ internal sealed class ServiceMethod { private fun Method.getFirstParameterAnnotations(): Array = parameterAnnotations.first() } - } diff --git a/scarlet/src/main/java/com/tinder/scarlet/internal/servicemethod/ServiceMethodExecutor.kt b/scarlet/src/main/java/com/tinder/scarlet/internal/servicemethod/ServiceMethodExecutor.kt index a822f8e6..71a08ae0 100644 --- a/scarlet/src/main/java/com/tinder/scarlet/internal/servicemethod/ServiceMethodExecutor.kt +++ b/scarlet/src/main/java/com/tinder/scarlet/internal/servicemethod/ServiceMethodExecutor.kt @@ -53,6 +53,5 @@ internal class ServiceMethodExecutor( is Receive -> receiveServiceMethodFactory else -> null } - } } diff --git a/scarlet/src/main/java/com/tinder/scarlet/internal/servicemethod/StreamAdapterResolver.kt b/scarlet/src/main/java/com/tinder/scarlet/internal/servicemethod/StreamAdapterResolver.kt index a9fce1df..bc58d0eb 100644 --- a/scarlet/src/main/java/com/tinder/scarlet/internal/servicemethod/StreamAdapterResolver.kt +++ b/scarlet/src/main/java/com/tinder/scarlet/internal/servicemethod/StreamAdapterResolver.kt @@ -25,5 +25,4 @@ internal class StreamAdapterResolver( val compositeException = CompositeException(*throwables.toTypedArray()) throw IllegalStateException("Cannot resolve stream adapter for type $type.", compositeException) } - } diff --git a/scarlet/src/main/java/com/tinder/scarlet/internal/utils/RuntimePlatform.kt b/scarlet/src/main/java/com/tinder/scarlet/internal/utils/RuntimePlatform.kt index 29724141..1600f086 100644 --- a/scarlet/src/main/java/com/tinder/scarlet/internal/utils/RuntimePlatform.kt +++ b/scarlet/src/main/java/com/tinder/scarlet/internal/utils/RuntimePlatform.kt @@ -12,7 +12,10 @@ internal sealed class RuntimePlatform { open fun isDefaultMethod(method: Method): Boolean = false open fun invokeDefaultMethod( - method: Method, declaringClass: Class<*>, proxy: Any, vararg args: Array? + method: Method, + declaringClass: Class<*>, + proxy: Any, + vararg args: Array? ): Any = throw UnsupportedOperationException() @@ -22,7 +25,10 @@ internal sealed class RuntimePlatform { override fun isDefaultMethod(method: Method): Boolean = method.isDefault override fun invokeDefaultMethod( - method: Method, declaringClass: Class<*>, proxy: Any, vararg args: Array? + method: Method, + declaringClass: Class<*>, + proxy: Any, + vararg args: Array? ): Any { // Because the service interface might not be public, we need to use a MethodHandle lookup // that ignores the visibility of the declaringClass. diff --git a/scarlet/src/main/java/com/tinder/scarlet/lifecycle/DefaultLifecycle.kt b/scarlet/src/main/java/com/tinder/scarlet/lifecycle/DefaultLifecycle.kt index bb0130cb..081e66a3 100644 --- a/scarlet/src/main/java/com/tinder/scarlet/lifecycle/DefaultLifecycle.kt +++ b/scarlet/src/main/java/com/tinder/scarlet/lifecycle/DefaultLifecycle.kt @@ -13,5 +13,4 @@ internal class DefaultLifecycle( init { lifecycleRegistry.onNext(Lifecycle.State.Started) } - } diff --git a/scarlet/src/main/java/com/tinder/scarlet/lifecycle/FlowableLifecycle.kt b/scarlet/src/main/java/com/tinder/scarlet/lifecycle/FlowableLifecycle.kt index e007b882..f065820d 100644 --- a/scarlet/src/main/java/com/tinder/scarlet/lifecycle/FlowableLifecycle.kt +++ b/scarlet/src/main/java/com/tinder/scarlet/lifecycle/FlowableLifecycle.kt @@ -26,5 +26,4 @@ internal class FlowableLifecycle( .map(List>::combine) return FlowableLifecycle(flowable, scheduler) } - } diff --git a/scarlet/src/main/java/com/tinder/scarlet/lifecycle/LifecycleRegistry.kt b/scarlet/src/main/java/com/tinder/scarlet/lifecycle/LifecycleRegistry.kt index 1d96726f..3a4b8962 100644 --- a/scarlet/src/main/java/com/tinder/scarlet/lifecycle/LifecycleRegistry.kt +++ b/scarlet/src/main/java/com/tinder/scarlet/lifecycle/LifecycleRegistry.kt @@ -78,4 +78,3 @@ class LifecycleRegistry internal constructor( } } } - diff --git a/scarlet/src/main/java/com/tinder/scarlet/retry/ExponentialBackoffStrategy.kt b/scarlet/src/main/java/com/tinder/scarlet/retry/ExponentialBackoffStrategy.kt index ee2753a5..98eeac82 100644 --- a/scarlet/src/main/java/com/tinder/scarlet/retry/ExponentialBackoffStrategy.kt +++ b/scarlet/src/main/java/com/tinder/scarlet/retry/ExponentialBackoffStrategy.kt @@ -21,5 +21,4 @@ class ExponentialBackoffStrategy( initialDurationMillis.toDouble() * Math.pow(2.0, retryCount.toDouble()) ) .toLong() - } diff --git a/scarlet/src/main/java/com/tinder/scarlet/retry/ExponentialWithJitterBackoffStrategy.kt b/scarlet/src/main/java/com/tinder/scarlet/retry/ExponentialWithJitterBackoffStrategy.kt index 1f3dfa24..707adb3a 100644 --- a/scarlet/src/main/java/com/tinder/scarlet/retry/ExponentialWithJitterBackoffStrategy.kt +++ b/scarlet/src/main/java/com/tinder/scarlet/retry/ExponentialWithJitterBackoffStrategy.kt @@ -25,5 +25,4 @@ class ExponentialWithJitterBackoffStrategy( private fun Long.withJitter(): Long = (0..this).random() private fun ClosedRange.random() = random.nextInt((endInclusive - start).toInt()) + start - } diff --git a/scarlet/src/main/java/com/tinder/scarlet/retry/LinearBackoffStrategy.kt b/scarlet/src/main/java/com/tinder/scarlet/retry/LinearBackoffStrategy.kt index bfd449ed..8c8792bd 100644 --- a/scarlet/src/main/java/com/tinder/scarlet/retry/LinearBackoffStrategy.kt +++ b/scarlet/src/main/java/com/tinder/scarlet/retry/LinearBackoffStrategy.kt @@ -13,5 +13,4 @@ class LinearBackoffStrategy( } override fun backoffDurationMillisAt(retryCount: Int): Long = durationMillis - } diff --git a/scarlet/src/test/java/com/tinder/scarlet/internal/connection/ConnectionFactoryTest.kt b/scarlet/src/test/java/com/tinder/scarlet/internal/connection/ConnectionFactoryTest.kt index 3e11ff7f..cb938f1f 100644 --- a/scarlet/src/test/java/com/tinder/scarlet/internal/connection/ConnectionFactoryTest.kt +++ b/scarlet/src/test/java/com/tinder/scarlet/internal/connection/ConnectionFactoryTest.kt @@ -31,5 +31,4 @@ internal class ConnectionFactoryTest { // Then assertThat(connection1.stateManager.lifecycle).isEqualTo(connection2.stateManager.lifecycle) } - } diff --git a/scarlet/src/test/java/com/tinder/scarlet/internal/connection/ConnectionTest.kt b/scarlet/src/test/java/com/tinder/scarlet/internal/connection/ConnectionTest.kt index 1aee4355..c6defdbe 100644 --- a/scarlet/src/test/java/com/tinder/scarlet/internal/connection/ConnectionTest.kt +++ b/scarlet/src/test/java/com/tinder/scarlet/internal/connection/ConnectionTest.kt @@ -61,5 +61,4 @@ internal class ConnectionTest { // Then then(webSocket).should().send(message) } - } diff --git a/scarlet/src/test/java/com/tinder/scarlet/internal/connection/LifecycleStateSubscriberTest.kt b/scarlet/src/test/java/com/tinder/scarlet/internal/connection/LifecycleStateSubscriberTest.kt index c4b81666..88e7aaa3 100644 --- a/scarlet/src/test/java/com/tinder/scarlet/internal/connection/LifecycleStateSubscriberTest.kt +++ b/scarlet/src/test/java/com/tinder/scarlet/internal/connection/LifecycleStateSubscriberTest.kt @@ -80,5 +80,4 @@ internal class LifecycleStateSubscriberTest { assertThatExceptionOfType(RuntimeException::class.java) .isThrownBy { flowable.subscribe(lifecycleStateSubscriber) } } - } diff --git a/scarlet/src/test/java/com/tinder/scarlet/internal/connection/WebSocketEventSubscriberTest.kt b/scarlet/src/test/java/com/tinder/scarlet/internal/connection/WebSocketEventSubscriberTest.kt index feec1ebe..ef12033d 100644 --- a/scarlet/src/test/java/com/tinder/scarlet/internal/connection/WebSocketEventSubscriberTest.kt +++ b/scarlet/src/test/java/com/tinder/scarlet/internal/connection/WebSocketEventSubscriberTest.kt @@ -56,5 +56,4 @@ internal class WebSocketEventSubscriberTest { assertThatExceptionOfType(RuntimeException::class.java) .isThrownBy { flowable.subscribe(webSocketEventSubscriber) } } - } diff --git a/scarlet/src/test/java/com/tinder/scarlet/internal/servicemethod/EventMapperTest.kt b/scarlet/src/test/java/com/tinder/scarlet/internal/servicemethod/EventMapperTest.kt index d8b84615..359ff57d 100644 --- a/scarlet/src/test/java/com/tinder/scarlet/internal/servicemethod/EventMapperTest.kt +++ b/scarlet/src/test/java/com/tinder/scarlet/internal/servicemethod/EventMapperTest.kt @@ -389,6 +389,5 @@ internal class EventMapperTest { ON_LIFECYCLE_TERMINATED, ON_STATE_CHANGE_TO_DESTROYED ) - } } diff --git a/scarlet/src/test/java/com/tinder/scarlet/internal/servicemethod/MessageAdapterResolverTest.kt b/scarlet/src/test/java/com/tinder/scarlet/internal/servicemethod/MessageAdapterResolverTest.kt index 37e9f1cb..5db8ab7b 100644 --- a/scarlet/src/test/java/com/tinder/scarlet/internal/servicemethod/MessageAdapterResolverTest.kt +++ b/scarlet/src/test/java/com/tinder/scarlet/internal/servicemethod/MessageAdapterResolverTest.kt @@ -77,5 +77,4 @@ internal class MessageAdapterResolverTest { } .withMessageContaining("Cannot resolve message adapter") } - } diff --git a/scarlet/src/test/java/com/tinder/scarlet/internal/servicemethod/ReceiveServiceMethodFactoryTest.kt b/scarlet/src/test/java/com/tinder/scarlet/internal/servicemethod/ReceiveServiceMethodFactoryTest.kt index 09567041..c1f21e17 100644 --- a/scarlet/src/test/java/com/tinder/scarlet/internal/servicemethod/ReceiveServiceMethodFactoryTest.kt +++ b/scarlet/src/test/java/com/tinder/scarlet/internal/servicemethod/ReceiveServiceMethodFactoryTest.kt @@ -196,5 +196,4 @@ internal class ReceiveServiceMethodFactoryTest { private inline fun param() = arrayOf(T::class.java.onlyMethod(), R::class.java) } } - } diff --git a/scarlet/src/test/java/com/tinder/scarlet/internal/servicemethod/ReceiveServiceMethodTest.kt b/scarlet/src/test/java/com/tinder/scarlet/internal/servicemethod/ReceiveServiceMethodTest.kt index c1e5e17d..d7177dca 100644 --- a/scarlet/src/test/java/com/tinder/scarlet/internal/servicemethod/ReceiveServiceMethodTest.kt +++ b/scarlet/src/test/java/com/tinder/scarlet/internal/servicemethod/ReceiveServiceMethodTest.kt @@ -63,5 +63,4 @@ internal class ReceiveServiceMethodTest { then(eventMapper).should().mapToData(event2) testSubscriber.assertNotTerminated() } - } diff --git a/scarlet/src/test/java/com/tinder/scarlet/internal/servicemethod/SendServiceMethodFactoryTest.kt b/scarlet/src/test/java/com/tinder/scarlet/internal/servicemethod/SendServiceMethodFactoryTest.kt index dd9555eb..fc3ef966 100644 --- a/scarlet/src/test/java/com/tinder/scarlet/internal/servicemethod/SendServiceMethodFactoryTest.kt +++ b/scarlet/src/test/java/com/tinder/scarlet/internal/servicemethod/SendServiceMethodFactoryTest.kt @@ -140,5 +140,4 @@ internal class SendServiceMethodFactoryTest { private inline fun param() = arrayOf(T::class.java.onlyMethod()) } } - } diff --git a/scarlet/src/test/java/com/tinder/scarlet/internal/servicemethod/ServiceMethodExecutorFactoryTest.kt b/scarlet/src/test/java/com/tinder/scarlet/internal/servicemethod/ServiceMethodExecutorFactoryTest.kt index 1f2fcd53..ad351c4e 100644 --- a/scarlet/src/test/java/com/tinder/scarlet/internal/servicemethod/ServiceMethodExecutorFactoryTest.kt +++ b/scarlet/src/test/java/com/tinder/scarlet/internal/servicemethod/ServiceMethodExecutorFactoryTest.kt @@ -185,5 +185,4 @@ internal class ServiceMethodExecutorFactoryTest { arrayOf(T::class.java, numberOfSendMethods, numberOfReceiveMethods) } } - } diff --git a/scarlet/src/test/java/com/tinder/scarlet/internal/servicemethod/ServiceMethodExecutorTest.kt b/scarlet/src/test/java/com/tinder/scarlet/internal/servicemethod/ServiceMethodExecutorTest.kt index f0417f51..eaa690ab 100644 --- a/scarlet/src/test/java/com/tinder/scarlet/internal/servicemethod/ServiceMethodExecutorTest.kt +++ b/scarlet/src/test/java/com/tinder/scarlet/internal/servicemethod/ServiceMethodExecutorTest.kt @@ -56,5 +56,4 @@ internal class ServiceMethodExecutorTest { serviceMethodExecutor.execute(notRegisteredMethod, arrayOf()) } } - } diff --git a/scarlet/src/test/java/com/tinder/scarlet/lifecycle/DefaultLifecycleTest.kt b/scarlet/src/test/java/com/tinder/scarlet/lifecycle/DefaultLifecycleTest.kt index 35a70791..8a9cdd64 100644 --- a/scarlet/src/test/java/com/tinder/scarlet/lifecycle/DefaultLifecycleTest.kt +++ b/scarlet/src/test/java/com/tinder/scarlet/lifecycle/DefaultLifecycleTest.kt @@ -20,5 +20,4 @@ internal class DefaultLifecycleTest { // Then testSubscriber.assertValues(Lifecycle.State.Started) } - } diff --git a/scarlet/src/test/java/com/tinder/scarlet/lifecycle/FlowableLifecycleTest.kt b/scarlet/src/test/java/com/tinder/scarlet/lifecycle/FlowableLifecycleTest.kt index c81068d2..b05d6046 100644 --- a/scarlet/src/test/java/com/tinder/scarlet/lifecycle/FlowableLifecycleTest.kt +++ b/scarlet/src/test/java/com/tinder/scarlet/lifecycle/FlowableLifecycleTest.kt @@ -46,5 +46,4 @@ class FlowableLifecycleTest { Lifecycle.State.Started ) } - } diff --git a/scarlet/src/test/java/com/tinder/scarlet/lifecycle/LifecycleRegistryTest.kt b/scarlet/src/test/java/com/tinder/scarlet/lifecycle/LifecycleRegistryTest.kt index 96c8988e..a290454b 100644 --- a/scarlet/src/test/java/com/tinder/scarlet/lifecycle/LifecycleRegistryTest.kt +++ b/scarlet/src/test/java/com/tinder/scarlet/lifecycle/LifecycleRegistryTest.kt @@ -235,5 +235,4 @@ internal class LifecycleRegistryTest { testSubscriber.assertValues(Lifecycle.State.Started, Lifecycle.State.Destroyed) testSubscriber.assertComplete() } - } diff --git a/scarlet/src/test/java/com/tinder/scarlet/retry/ExponentialBackoffStrategyTest.kt b/scarlet/src/test/java/com/tinder/scarlet/retry/ExponentialBackoffStrategyTest.kt index 8975fd20..32ede508 100644 --- a/scarlet/src/test/java/com/tinder/scarlet/retry/ExponentialBackoffStrategyTest.kt +++ b/scarlet/src/test/java/com/tinder/scarlet/retry/ExponentialBackoffStrategyTest.kt @@ -44,7 +44,6 @@ internal class ExponentialBackoffStrategyTest { private fun param(baseDuration: Long, maxDuration: Long) = arrayOf(baseDuration, maxDuration) } - } @RunWith(Parameterized::class) diff --git a/scarlet/src/test/java/com/tinder/scarlet/retry/ExponentialBackoffWithJitterBackoffStrategyTest.kt b/scarlet/src/test/java/com/tinder/scarlet/retry/ExponentialBackoffWithJitterBackoffStrategyTest.kt index 48cbe234..f715be06 100644 --- a/scarlet/src/test/java/com/tinder/scarlet/retry/ExponentialBackoffWithJitterBackoffStrategyTest.kt +++ b/scarlet/src/test/java/com/tinder/scarlet/retry/ExponentialBackoffWithJitterBackoffStrategyTest.kt @@ -48,7 +48,6 @@ internal class ExponentialBackoffWithJitterBackoffStrategyTest { private fun param(baseDuration: Long, maxDuration: Long) = arrayOf(baseDuration, maxDuration) } - } @RunWith(Parameterized::class) @@ -227,7 +226,10 @@ internal class ExponentialBackoffWithJitterBackoffStrategyTest { ) private fun param( - baseDuration: Long, maxDuration: Long, jitterPercentage: Int, retryCount: Int, + baseDuration: Long, + maxDuration: Long, + jitterPercentage: Int, + retryCount: Int, expectedWaitDuration: Long ) = arrayOf(baseDuration, maxDuration, jitterPercentage, retryCount, expectedWaitDuration) diff --git a/state-machine/src/main/java/com/tinder/statemachine/StateMachine.kt b/state-machine/src/main/java/com/tinder/statemachine/StateMachine.kt index 8f7081ee..33372f52 100644 --- a/state-machine/src/main/java/com/tinder/statemachine/StateMachine.kt +++ b/state-machine/src/main/java/com/tinder/statemachine/StateMachine.kt @@ -158,6 +158,4 @@ class StateMachine private constructor() { fun create(init: Builder.() -> Unit) = Builder().apply(init).build() } - } -