diff --git a/libraries/stdlib/src/kotlin/collections/Exceptions.kt b/libraries/stdlib/src/kotlin/collections/Exceptions.kt index eac02e90037..d730fdda6a0 100644 --- a/libraries/stdlib/src/kotlin/collections/Exceptions.kt +++ b/libraries/stdlib/src/kotlin/collections/Exceptions.kt @@ -1,5 +1,7 @@ package kotlin +deprecated("This exception is no longer thrown by any standard library classes and is going to be removed") public class EmptyIterableException(private val it: Iterable<*>) : RuntimeException("$it is empty") +deprecated("This exception is no longer thrown by any standard library classes and is going to be removed") public class DuplicateKeyException(message : String = "Duplicate keys detected") : RuntimeException(message) \ No newline at end of file diff --git a/libraries/stdlib/src/kotlin/concurrent/FunctionalList.kt b/libraries/stdlib/src/kotlin/concurrent/FunctionalList.kt index dd7595dd718..3f5f969aa81 100644 --- a/libraries/stdlib/src/kotlin/concurrent/FunctionalList.kt +++ b/libraries/stdlib/src/kotlin/concurrent/FunctionalList.kt @@ -1,5 +1,6 @@ package kotlin.concurrent +deprecated("This class is unfinished work. It will be removed from the standard library and replaced by a separate persistent collections library") public abstract class FunctionalList(public val size: Int) { public abstract val head: T public abstract val tail: FunctionalList diff --git a/libraries/stdlib/src/kotlin/concurrent/FunctionalQueue.kt b/libraries/stdlib/src/kotlin/concurrent/FunctionalQueue.kt index 33d3c18a822..5e51e1cbe26 100644 --- a/libraries/stdlib/src/kotlin/concurrent/FunctionalQueue.kt +++ b/libraries/stdlib/src/kotlin/concurrent/FunctionalQueue.kt @@ -2,6 +2,7 @@ package kotlin.concurrent import java.util.concurrent.Executor +deprecated("This class is unfinished work. It will be removed from the standard library and replaced by a separate persistent collections library") public class FunctionalQueue ( private val input: FunctionalList = FunctionalList.emptyList(), private val output: FunctionalList = FunctionalList.emptyList() diff --git a/libraries/stdlib/src/kotlin/properties/Properties.kt b/libraries/stdlib/src/kotlin/properties/Properties.kt index 1b5e288039e..8a22e37bb9c 100644 --- a/libraries/stdlib/src/kotlin/properties/Properties.kt +++ b/libraries/stdlib/src/kotlin/properties/Properties.kt @@ -3,6 +3,7 @@ package kotlin.properties import java.util.HashMap import java.util.ArrayList +deprecated("This class is part of an old, incomplete and suboptimal design of change notifications and is going to be removed") public class ChangeEvent( public val source: Any, public val name: String, @@ -12,6 +13,7 @@ public class ChangeEvent( override fun toString(): String = "ChangeEvent($name, $oldValue, $newValue)" } +deprecated("This class is part of an old, incomplete and suboptimal design of change notifications and is going to be removed") public trait ChangeListener { public fun onPropertyChange(event: ChangeEvent): Unit } @@ -21,6 +23,7 @@ public trait ChangeListener { * updates for easier binding to user interfaces, undo/redo command stacks and * change tracking mechanisms for persistence or distributed change notifications. */ +deprecated("This class is part of an old, incomplete and suboptimal design of change notifications and is going to be removed") public abstract class ChangeSupport { private var allListeners: MutableList? = null private var nameListeners: MutableMap>? = null @@ -81,30 +84,3 @@ public abstract class ChangeSupport { //addChangeListener(name, DelegateChangeListener(fn)) } } - -/* -TODO this seems to generate a compiler barf! -see http://youtrack.jetbrains.com/issue/KT-1362 - - protected fun createChangeListener(fn: (ChangeEvent) -> Unit): ChangeListener { - return DelegateChangeListener(fn) - } - - protected fun createChangeListener(fn: (ChangeEvent) -> Unit): ChangeListener { - return ChangeListener { - public override fun onPropertyChange(event: ChangeEvent): Unit { - fn(event) - } - } - } - -} - - -class DelegateChangeListener(val f: (ChangeEvent) -> Unit) : ChangeListener { - public override fun onPropertyChange(event: ChangeEvent): Unit { - f(event) - } -} - - diff --git a/libraries/stdlib/src/kotlin/template/Templates.kt b/libraries/stdlib/src/kotlin/template/Templates.kt index f0890bf0c7f..b8820b645f7 100644 --- a/libraries/stdlib/src/kotlin/template/Templates.kt +++ b/libraries/stdlib/src/kotlin/template/Templates.kt @@ -10,6 +10,7 @@ import java.util.Date // TODO this class should move into the runtime // in kotlin.StringTemplate +deprecated("This class is part of an experimental implementation of string templates and is going to be removed") public class StringTemplate(private val values: Array) { /** @@ -38,6 +39,7 @@ public class StringTemplate(private val values: Array) { * * See [[HtmlFormatter] and [[LocaleFormatter] respectively. */ +deprecated("This function is part of an experimental implementation of string templates and is going to be removed") public fun StringTemplate.toString(formatter: Formatter): String { val buffer = StringBuilder() append(buffer, formatter) @@ -48,6 +50,7 @@ public fun StringTemplate.toString(formatter: Formatter): String { * Appends the text representation of this string template to the given output * using the supplied formatter */ +deprecated("This function is part of an experimental implementation of string templates and is going to be removed") public fun StringTemplate.append(out: Appendable, formatter: Formatter): Unit { var constantText = true this.forEach { @@ -69,11 +72,13 @@ public fun StringTemplate.append(out: Appendable, formatter: Formatter): Unit { * Converts this string template to internationalised text using the supplied * [[LocaleFormatter]] */ +deprecated("This function is part of an experimental implementation of string templates and is going to be removed") public fun StringTemplate.toLocale(formatter: LocaleFormatter = LocaleFormatter()): String = toString(formatter) /** * Converts this string template to HTML text */ +deprecated("This function is part of an experimental implementation of string templates and is going to be removed") public fun StringTemplate.toHtml(formatter: HtmlFormatter = HtmlFormatter()): String = toString(formatter) /** @@ -81,6 +86,7 @@ public fun StringTemplate.toHtml(formatter: HtmlFormatter = HtmlFormatter()): St * how to format values for a particular [[Locale]] such as with the [[LocaleFormatter]] or * to escape particular characters in different output formats such as [[HtmlFormatter] */ +deprecated("This trait is part of an experimental implementation of string templates and is going to be removed") public trait Formatter { public fun format(buffer: Appendable, value: Any?): Unit } @@ -89,6 +95,7 @@ public trait Formatter { * Formats strings with no special encoding other than allowing the null text to be * configured */ +deprecated("This class is part of an experimental implementation of string templates and is going to be removed") public open class ToStringFormatter : Formatter { private val nullString: String = "null" @@ -114,11 +121,13 @@ public open class ToStringFormatter : Formatter { } } +deprecated("This property is part of an experimental implementation of string templates and is going to be removed") public val defaultLocale: Locale = Locale.getDefault() /** * Formats values using a given [[Locale]] for internationalisation */ +deprecated("This class is part of an experimental implementation of string templates and is going to be removed") public open class LocaleFormatter(protected val locale: Locale = defaultLocale) : ToStringFormatter() { override fun toString(): String = "LocaleFormatter{$locale}" @@ -149,6 +158,7 @@ public open class LocaleFormatter(protected val locale: Locale = defaultLocale) /** * Formats values for HTML encoding, escaping special characters in HTML. */ +deprecated("This class is part of an experimental implementation of string templates and is going to be removed") public class HtmlFormatter(locale: Locale = defaultLocale) : LocaleFormatter(locale) { override fun toString(): String = "HtmlFormatter{$locale}"