diff --git a/CHANGELOG.md b/CHANGELOG.md index 01b59c6d..b02d1fc6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +# Unreleased +* core: MutableRegistry.create() is marked protected, as it should not be used directly. Use `require()` instead. + # 1.6.7 * core: Converter can now force initialize type arguments' companion objects * core: Decimal.absoluteValue and Decimal.sign introduced, like other numeric types in Kotlin diff --git a/core/src/Registry.kt b/core/src/Registry.kt index a2369a78..0ce9ad10 100644 --- a/core/src/Registry.kt +++ b/core/src/Registry.kt @@ -44,7 +44,7 @@ open class SimpleRegistry: MutableRegistry { override fun require(type: KClass) = optional(type) ?: create(type).also { register(type, it) } override fun requireAll(type: KClass): List = instances.values.filter { type.java.isAssignableFrom(it.javaClass) }.distinct() as List - open fun create(type: KClass): T = type.createInstance() + protected open fun create(type: KClass): T = type.createInstance() } /**