diff --git a/idea/idea-completion/testData/basic/common/parameterNameAndType/NoDuplication.kt b/idea/idea-completion/testData/basic/common/parameterNameAndType/NoDuplication.kt index 9e1fef8377a..ad0b1a19883 100644 --- a/idea/idea-completion/testData/basic/common/parameterNameAndType/NoDuplication.kt +++ b/idea/idea-completion/testData/basic/common/parameterNameAndType/NoDuplication.kt @@ -1,6 +1,6 @@ import kotlin.properties.* -fun f(keyMissin) +fun f(readonlypr) -// EXIST: { lookupString: "keyMissingException", itemText: "keyMissingException: KeyMissingException", tailText: " (kotlin.properties)" } +// EXIST: { lookupString: "readOnlyProperty", itemText: "readOnlyProperty: ReadOnlyProperty", tailText: " (kotlin.properties)" } // NUMBER: 1 diff --git a/libraries/stdlib/src/kotlin/properties/Delegation.kt b/libraries/stdlib/src/kotlin/properties/Delegation.kt index a0e9b4eccf0..91eeab0c598 100644 --- a/libraries/stdlib/src/kotlin/properties/Delegation.kt +++ b/libraries/stdlib/src/kotlin/properties/Delegation.kt @@ -211,16 +211,6 @@ private class BlockingLazyVal(lock: Any?, private val initializer: () -> T) : } } -/** - * Exception thrown by the default implementation of property delegates which store values in a map - * when the map does not contain the corresponding key. - */ -@Deprecated("Do not throw or catch this exception, use NoSuchElementException instead.") -public class KeyMissingException - @Deprecated("Throw NoSuchElementException instead.", ReplaceWith("NoSuchElementException(message)")) - constructor(message: String): NoSuchElementException(message) - - /** * Implements the core logic for a property delegate that stores property values in a map. * @param T the type of the object that owns the delegated property. @@ -246,7 +236,7 @@ public abstract class MapVal() : ReadOnlyProperty { * @param property the property for which the value was requested. */ protected open fun default(ref: T, property: PropertyMetadata): V { - throw KeyMissingException("The value for property ${property.name} is missing in $ref.") + throw NoSuchElementException("The value for property ${property.name} is missing in $ref.") } public override fun get(thisRef: T, property: PropertyMetadata) : V { @@ -272,7 +262,7 @@ public abstract class MapVar() : MapVal(), ReadWriteProperty String = {it.name} -private val throwKeyNotFound: (Any?, Any?) -> Nothing = {thisRef, key -> throw KeyMissingException("The value for key $key is missing from $thisRef.")} +private val throwKeyNotFound: (Any?, Any?) -> Nothing = {thisRef, key -> throw NoSuchElementException("The value for key $key is missing from $thisRef.") } /** * Implements a read-only property delegate that stores the property values in a given map instance and uses the given