Skip to content

Commit 90b4008

Browse files
committed
Replaced Enum.values with Enum.entries
from FasterXML/jackson-module-kotlin#869
1 parent 96b9e4a commit 90b4008

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/main/kotlin/io/github/projectmapk/jackson/module/kogera/KotlinFeature.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public enum class KotlinFeature(internal val enabledByDefault: Boolean) {
8989

9090
public companion object {
9191
internal val defaults
92-
get() = values().fold(BitSet(Int.SIZE_BITS)) { acc, cur ->
92+
get() = entries.fold(BitSet(Int.SIZE_BITS)) { acc, cur ->
9393
acc.apply { if (cur.enabledByDefault) this.or(cur.bitSet) }
9494
}
9595
}

src/test/kotlin/io/github/projectmapk/jackson/module/kogera/KotlinModuleTest.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class KotlinModuleTest {
1515
@Test
1616
fun setKotlinFeatureTest() {
1717
val builder = KotlinModule.Builder().apply {
18-
KotlinFeature.values().forEach { enable(it) }
18+
KotlinFeature.entries.forEach { enable(it) }
1919
}
2020

2121
assertTrue(builder.isEnabled(KotlinFeature.NullToEmptyCollection))
@@ -27,7 +27,7 @@ class KotlinModuleTest {
2727
assertTrue(builder.isEnabled(KotlinFeature.UseJavaDurationConversion))
2828

2929
builder.apply {
30-
KotlinFeature.values().forEach { disable(it) }
30+
KotlinFeature.entries.forEach { disable(it) }
3131
}
3232

3333
assertFalse(builder.isEnabled(KotlinFeature.NullToEmptyCollection))
@@ -84,7 +84,7 @@ class KotlinModuleTest {
8484
val module = KotlinModule.Builder().apply {
8585
withCacheSize(KotlinModule.CacheSize(123, 321))
8686

87-
KotlinFeature.values().forEach {
87+
KotlinFeature.entries.forEach {
8888
configure(it, enabled)
8989
}
9090
}.build()

0 commit comments

Comments
 (0)