-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
KTOR-7298: Load modules dynamically only if development mode is enabl…
…ed (#4715) * Make the module list immutable after ServerConfig creation * Handle cases when lambda has more or less than one constructor
- Loading branch information
Showing
4 changed files
with
95 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 6 additions & 6 deletions
12
ktor-server/ktor-server-core/jvm/src/io/ktor/server/engine/ServerHostUtils.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
/* | ||
* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. | ||
*/ | ||
* Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. | ||
*/ | ||
|
||
package io.ktor.server.engine | ||
|
||
import kotlin.reflect.* | ||
import kotlin.reflect.jvm.* | ||
import kotlin.reflect.KFunction | ||
import kotlin.reflect.jvm.javaMethod | ||
|
||
/** | ||
* Obtain function FQName. | ||
*/ | ||
internal fun Function<*>.methodName(): String { | ||
val method = (this as? KFunction<*>)?.javaMethod ?: return "${javaClass.name}.invoke" | ||
|
||
val clazz = method.declaringClass | ||
val className = method.declaringClass.name | ||
val name = method.name | ||
return "${clazz.name}.$name" | ||
return "$className.$name" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters