diff --git a/idea/testData/copyPaste/imports/DependencyOnStdLib.expected.kt b/idea/testData/copyPaste/imports/DependencyOnStdLib.expected.kt index 5f2a0f5472c..89767829ef2 100644 --- a/idea/testData/copyPaste/imports/DependencyOnStdLib.expected.kt +++ b/idea/testData/copyPaste/imports/DependencyOnStdLib.expected.kt @@ -1,5 +1,5 @@ package to -import kotlin.concurrent.FunctionalList +import kotlin.properties.ObservableProperty -fun f(l: FunctionalList) {} \ No newline at end of file +fun f(l: ObservableProperty) {} \ No newline at end of file diff --git a/idea/testData/copyPaste/imports/DependencyOnStdLib.expected.names b/idea/testData/copyPaste/imports/DependencyOnStdLib.expected.names index 1e28860500b..2a89ec4170a 100644 --- a/idea/testData/copyPaste/imports/DependencyOnStdLib.expected.names +++ b/idea/testData/copyPaste/imports/DependencyOnStdLib.expected.names @@ -1,2 +1,2 @@ kotlin.Int -kotlin.concurrent.FunctionalList +kotlin.properties.ObservableProperty diff --git a/idea/testData/copyPaste/imports/DependencyOnStdLib.kt b/idea/testData/copyPaste/imports/DependencyOnStdLib.kt index 4c5c5306087..73104657ebc 100644 --- a/idea/testData/copyPaste/imports/DependencyOnStdLib.kt +++ b/idea/testData/copyPaste/imports/DependencyOnStdLib.kt @@ -2,6 +2,6 @@ package g -import kotlin.concurrent.FunctionalList +import kotlin.properties.ObservableProperty -fun f(l: FunctionalList) {} \ No newline at end of file +fun f(l: ObservableProperty) {} \ No newline at end of file diff --git a/idea/testData/intentions/insertExplicitTypeArguments/insertImportForArg.kt b/idea/testData/intentions/insertExplicitTypeArguments/insertImportForArg.kt index 10e3f0aff50..ab3c5d372c9 100644 --- a/idea/testData/intentions/insertExplicitTypeArguments/insertImportForArg.kt +++ b/idea/testData/intentions/insertExplicitTypeArguments/insertImportForArg.kt @@ -1,4 +1,4 @@ -fun foo(c: kotlin.support.AbstractIterator>) { +fun foo(c: kotlin.support.AbstractIterator>) { bar(c) } diff --git a/idea/testData/intentions/insertExplicitTypeArguments/insertImportForArg.kt.after b/idea/testData/intentions/insertExplicitTypeArguments/insertImportForArg.kt.after index 1e09c2b3b66..2e636643e12 100644 --- a/idea/testData/intentions/insertExplicitTypeArguments/insertImportForArg.kt.after +++ b/idea/testData/intentions/insertExplicitTypeArguments/insertImportForArg.kt.after @@ -1,8 +1,8 @@ -import kotlin.concurrent.FunctionalList +import kotlin.properties.ObservableProperty import kotlin.support.AbstractIterator -fun foo(c: kotlin.support.AbstractIterator>) { - bar>>(c) +fun foo(c: kotlin.support.AbstractIterator>) { + bar>>(c) } fun bar(t: T): T = t diff --git a/libraries/stdlib/src/kotlin/concurrent/FunctionalList.kt b/libraries/stdlib/src/kotlin/concurrent/FunctionalList.kt deleted file mode 100644 index e54a6e9e583..00000000000 --- a/libraries/stdlib/src/kotlin/concurrent/FunctionalList.kt +++ /dev/null @@ -1,57 +0,0 @@ -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 - - public val empty: Boolean - get() = size == 0 - - public fun add(element: T): FunctionalList = FunctionalList.Standard(element, this) - - public fun reversed(): FunctionalList { - if(empty) - return this - - var cur = tail - var new = of(head) - - while(!cur.empty) { - new = new.add(cur.head) - cur = cur.tail - } - return new - } - - public fun iterator() : Iterator = object: Iterator { - var cur = this@FunctionalList - - public override fun next(): T { - if(cur.empty) - throw java.util.NoSuchElementException() - - val head = cur.head - cur = cur.tail - return head - } - - override fun hasNext(): Boolean = !cur.empty - } - - private class Empty() : FunctionalList(0) { - override val head: T - get() = throw java.util.NoSuchElementException() - override val tail: FunctionalList - get() = throw java.util.NoSuchElementException() - } - - private class Standard(override val head: T, override val tail: FunctionalList) : FunctionalList(tail.size + 1) - - companion object { - public fun emptyList(): FunctionalList = Empty() - - public fun of(element: T): FunctionalList = FunctionalList.Standard(element, emptyList()) - } -} - diff --git a/libraries/stdlib/src/kotlin/concurrent/FunctionalQueue.kt b/libraries/stdlib/src/kotlin/concurrent/FunctionalQueue.kt deleted file mode 100644 index 5e51e1cbe26..00000000000 --- a/libraries/stdlib/src/kotlin/concurrent/FunctionalQueue.kt +++ /dev/null @@ -1,31 +0,0 @@ -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() -) { - - public val size: Int - get() = input.size + output.size - - public val empty: Boolean - get() = size == 0 - - public fun add(element: T): FunctionalQueue = FunctionalQueue(input add element, output) - - public fun addFirst(element: T): FunctionalQueue = FunctionalQueue(input, output add element) - - public fun removeFirst(): Pair> = - if (output.empty) { - if (input.empty) - throw java.util.NoSuchElementException() - else - FunctionalQueue(FunctionalList.emptyList(), input.reversed()).removeFirst() - } - else { - Pair(output.head, FunctionalQueue(input, output.tail)) - } -} diff --git a/libraries/stdlib/test/concurrent/FListTest.kt b/libraries/stdlib/test/concurrent/FListTest.kt deleted file mode 100644 index fbc89746f6a..00000000000 --- a/libraries/stdlib/test/concurrent/FListTest.kt +++ /dev/null @@ -1,16 +0,0 @@ -package test.concurrent - -import kotlin.concurrent.* -import junit.framework.* - -class FListTest() : TestCase() { - fun testEmpty() { - val empty = FunctionalQueue () - Assert.assertTrue(empty.empty) - } - - fun testNonEmpty() { -// val empty = FunctionalList.emptyList () -// assertTrue(!(empty + 10).empty) - } -}