Skip to content

Commit 1554d03

Browse files
committed
Fix some small things
1 parent 78370ad commit 1554d03

File tree

4 files changed

+10
-9
lines changed

4 files changed

+10
-9
lines changed

kotlinx-coroutines-core/common/src/internal/LocalAtomics.common.kt

+2-4
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,11 @@ package kotlinx.coroutines.internal
55
* where atomicfu doesn't support its tranformations.
66
*
77
* Have `Local` prefix to avoid AFU clashes during star-imports
8+
*
9+
* TODO: remove after https://youtrack.jetbrains.com/issue/KT-62423/
810
*/
911
internal expect class LocalAtomicInt(value: Int) {
1012
fun get(): Int
1113
fun set(value: Int)
1214
fun decrementAndGet(): Int
1315
}
14-
15-
internal inline var LocalAtomicInt.value
16-
get() = get()
17-
set(value) = set(value)

kotlinx-coroutines-core/jvm/src/flow/internal/FlowExceptions.kt

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package kotlinx.coroutines.flow.internal
22

33
import kotlinx.coroutines.*
4-
import kotlinx.coroutines.flow.*
54

65
internal actual class AbortFlowException actual constructor(
76
@JvmField @Transient actual val owner: Any

kotlinx-coroutines-core/jvm/src/internal/FastServiceLoader.kt

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
package kotlinx.coroutines.internal
22

3+
import kotlinx.coroutines.CoroutineExceptionHandler
34
import java.io.*
45
import java.net.*
56
import java.util.*
67
import java.util.jar.*
78
import java.util.zip.*
8-
import kotlin.collections.ArrayList
99

1010
/**
1111
* Don't use JvmField here to enable R8 optimizations via "assumenosideeffects"
@@ -68,7 +68,7 @@ internal object FastServiceLoader {
6868
// Also search for test-module factory
6969
createInstanceOf(clz, "kotlinx.coroutines.test.internal.TestMainDispatcherFactory")?.apply { result.add(this) }
7070
result
71-
} catch (e: Throwable) {
71+
} catch (_: Throwable) {
7272
// Fallback to the regular SL in case of any unexpected exception
7373
load(clz, clz.classLoader)
7474
}
@@ -85,15 +85,15 @@ internal object FastServiceLoader {
8585
return try {
8686
val clz = Class.forName(serviceClass, true, baseClass.classLoader)
8787
baseClass.cast(clz.getDeclaredConstructor().newInstance())
88-
} catch (e: ClassNotFoundException) { // Do not fail if TestMainDispatcherFactory is not found
88+
} catch (_: ClassNotFoundException) { // Do not fail if TestMainDispatcherFactory is not found
8989
null
9090
}
9191
}
9292

9393
private fun <S> load(service: Class<S>, loader: ClassLoader): List<S> {
9494
return try {
9595
loadProviders(service, loader)
96-
} catch (e: Throwable) {
96+
} catch (_: Throwable) {
9797
// Fallback to default service loader
9898
ServiceLoader.load(service, loader).toList()
9999
}

kotlinx-coroutines-core/jvm/test/MutexCancellationStressTest.kt

+4
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,7 @@ class MutexCancellationStressTest : TestBase() {
8080
dispatcher.close()
8181
}
8282
}
83+
84+
private inline var AtomicInteger.value
85+
get() = get()
86+
set(value) = set(value)

0 commit comments

Comments
 (0)