Skip to content

Commit

Permalink
Merge pull request #44919 from stephan-strate/kotlin-empty-set-regres…
Browse files Browse the repository at this point in the history
…sion

Register Kotlin's empty set for reflection
  • Loading branch information
gsmet authored Dec 4, 2024
2 parents eab567b + c9b8046 commit 3fb393d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ void registerKotlinReflection(final BuildProducer<ReflectiveClassBuildItem> refl
reflectiveClass.produce(ReflectiveClassBuildItem.builder("kotlin.KotlinVersion$Companion[]").constructors(false)
.build());
reflectiveClass.produce(
ReflectiveClassBuildItem.builder("kotlin.collections.EmptyList", "kotlin.collections.EmptyMap").build());
ReflectiveClassBuildItem
.builder("kotlin.collections.EmptyList", "kotlin.collections.EmptyMap", "kotlin.collections.EmptySet")
.build());

nativeResourcePatterns.produce(builder().includePatterns(
"META-INF/.*.kotlin_module$",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,5 +85,11 @@ class GreetingResource {
return emptyMap<String, String>()
}

@GET
@Path("emptySet")
fun emptySet(): Set<String> {
return emptySet<String>()
}

fun reflect() = "hello, world"
}
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,9 @@ open class ResourceTest {
fun testEmptyMap() {
When { get("/emptyList") } Then { statusCode(200) }
}

@Test
fun testEmptySet() {
When { get("/emptySet") } Then { statusCode(200) }
}
}

0 comments on commit 3fb393d

Please sign in to comment.