Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions release-notes/CREDITS-2.x
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Contributors:
# 2.17.0 (not yet released)

WrongWrong (@k163377)
* #745: Modified isKotlinClass determination method.
* #744: API deprecation update for KotlinModule.
* #743: Fix handling of vararg deserialization.
* #742: Minor performance improvements to NullToEmptyCollection/Map.
Expand Down
1 change: 1 addition & 0 deletions release-notes/VERSION-2.x
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Co-maintainers:

2.17.0 (not yet released)

#745: Modified isKotlinClass determination method.
#744: Functions that were already marked as deprecated,
such as the primary constructor in KotlinModule and some functions in Builder,
are scheduled for removal in 2.18 and their DeprecationLevel has been raised to Error.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@ import com.fasterxml.jackson.module.kotlin.SingletonSupport.DISABLED
import java.util.*
import kotlin.reflect.KClass

private const val metadataFqName = "kotlin.Metadata"

fun Class<*>.isKotlinClass(): Boolean {
return declaredAnnotations.any { it.annotationClass.java.name == metadataFqName }
}
fun Class<*>.isKotlinClass(): Boolean = this.isAnnotationPresent(Metadata::class.java)

/**
* @param reflectionCacheSize Default: 512. Size, in items, of the caches used for mapping objects.
Expand Down