Drop deprecated API.
This commit is contained in:
@@ -54,30 +54,6 @@ import kotlin.jvm.internal.Intrinsic
|
||||
*/
|
||||
@Intrinsic("kotlin.arrays.array") public fun booleanArrayOf(vararg content : Boolean) : BooleanArray = content
|
||||
|
||||
// TODO: Move inputStream to kotlin.io
|
||||
/**
|
||||
* Creates an input stream for reading data from this byte array.
|
||||
*/
|
||||
@Deprecated("Use inputStream() method instead.", ReplaceWith("this.inputStream()", "kotlin.io.inputStream"))
|
||||
public val ByteArray.inputStream : ByteArrayInputStream
|
||||
get() = inputStream()
|
||||
|
||||
/**
|
||||
* Creates an input stream for reading data from this byte array.
|
||||
*/
|
||||
@Deprecated("Use inputStream() method from kotlin.io package instead.", ReplaceWith("this.inputStream()", "kotlin.io.inputStream"))
|
||||
@HiddenDeclaration
|
||||
public fun ByteArray.inputStream(): ByteArrayInputStream = ByteArrayInputStream(this)
|
||||
|
||||
/**
|
||||
* Creates an input stream for reading data from the specified portion of this byte array.
|
||||
* @param offset the start offset of the portion of the array to read.
|
||||
* @param length the length of the portion of the array to read.
|
||||
*/
|
||||
@Deprecated("Use inputStream() method from kotlin.io package instead.", ReplaceWith("this.inputStream(offset, length)", "kotlin.io.inputStream"))
|
||||
@HiddenDeclaration
|
||||
public fun ByteArray.inputStream(offset: Int, length: Int) : ByteArrayInputStream = ByteArrayInputStream(this, offset, length)
|
||||
|
||||
/**
|
||||
* Converts the contents of this byte array to a string using the specified [charset].
|
||||
*/
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
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)
|
||||
@@ -80,13 +80,6 @@ public fun <T : Any> listOfNotNull(vararg values: T?): List<T> = values.filterNo
|
||||
public val Collection<*>.indices: IntRange
|
||||
get() = 0..size() - 1
|
||||
|
||||
/**
|
||||
* Returns an [IntRange] that starts with zero and ends at the value of this number but does not include it.
|
||||
*/
|
||||
@Deprecated("Use 0..n-1 range instead.", ReplaceWith("0..this - 1"))
|
||||
public val Int.indices: IntRange
|
||||
get() = 0..this - 1
|
||||
|
||||
/**
|
||||
* Returns the index of the last item in the list or -1 if the list is empty.
|
||||
*
|
||||
|
||||
@@ -29,10 +29,6 @@ public fun <T> Iterator<T>.asSequence(): Sequence<T> {
|
||||
return iteratorSequence.constrainOnce()
|
||||
}
|
||||
|
||||
@Deprecated("Use asSequence() instead.", ReplaceWith("asSequence()"))
|
||||
public fun <T> Iterator<T>.sequence(): Sequence<T> = asSequence()
|
||||
|
||||
|
||||
/**
|
||||
* Creates a sequence that returns all values from this enumeration. The sequence is constrained to be iterated only once.
|
||||
*/
|
||||
|
||||
@@ -54,16 +54,3 @@ public inline fun <T> ReentrantReadWriteLock.write(action: () -> T): T {
|
||||
wl.unlock()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Executes the given [operation] and awaits for CountDownLatch.
|
||||
*
|
||||
* @return the return value of the action.
|
||||
*/
|
||||
@Deprecated("Use CountDownLatch(Int) instead and await it manually.")
|
||||
public fun <T> Int.latch(operation: CountDownLatch.() -> T): T {
|
||||
val latch = CountDownLatch(this)
|
||||
val result = latch.operation()
|
||||
latch.await()
|
||||
return result
|
||||
}
|
||||
|
||||
@@ -1,86 +0,0 @@
|
||||
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,
|
||||
public val oldValue: Any?,
|
||||
public val newValue: Any?
|
||||
) {
|
||||
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 interface ChangeListener {
|
||||
public fun onPropertyChange(event: ChangeEvent): Unit
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents an object where properties can be listened to and notified on
|
||||
* 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<ChangeListener>? = null
|
||||
private var nameListeners: MutableMap<String, MutableList<ChangeListener>>? = null
|
||||
|
||||
|
||||
public fun addChangeListener(listener: ChangeListener) {
|
||||
if (allListeners == null) {
|
||||
allListeners = ArrayList<ChangeListener>()
|
||||
}
|
||||
allListeners?.add(listener)
|
||||
}
|
||||
|
||||
public fun addChangeListener(name: String, listener: ChangeListener) {
|
||||
if (nameListeners == null) {
|
||||
nameListeners = HashMap<String, MutableList<ChangeListener>>()
|
||||
}
|
||||
var listeners = nameListeners?.get(name)
|
||||
if (listeners == null) {
|
||||
listeners = arrayListOf<ChangeListener>()
|
||||
nameListeners?.put(name, listeners!!)
|
||||
}
|
||||
listeners?.add(listener)
|
||||
}
|
||||
|
||||
protected fun <T> changeProperty(name: String, oldValue: T?, newValue: T?): Unit {
|
||||
if (oldValue != newValue) {
|
||||
firePropertyChanged(ChangeEvent(this, name, oldValue, newValue))
|
||||
}
|
||||
}
|
||||
|
||||
protected fun firePropertyChanged(event: ChangeEvent): Unit {
|
||||
if (nameListeners != null) {
|
||||
val listeners = nameListeners?.get(event.name)
|
||||
if (listeners != null) {
|
||||
for (listener in listeners) {
|
||||
listener.onPropertyChange(event)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (allListeners != null) {
|
||||
for (listener in allListeners!!) {
|
||||
listener.onPropertyChange(event)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected fun property<T>(init: T): ReadWriteProperty<Any?, T> {
|
||||
return Delegates.observable(init) { desc, oldValue, newValue -> changeProperty(desc.name, oldValue, newValue) }
|
||||
}
|
||||
|
||||
public fun onPropertyChange(fn: (ChangeEvent) -> Unit) {
|
||||
// TODO
|
||||
//addChangeListener(DelegateChangeListener(fn))
|
||||
}
|
||||
|
||||
public fun onPropertyChange(name: String, fn: (ChangeEvent) -> Unit) {
|
||||
// TODO
|
||||
//addChangeListener(name, DelegateChangeListener(fn))
|
||||
}
|
||||
}
|
||||
@@ -61,12 +61,6 @@ public fun Char.isJavaIdentifierPart(): Boolean = Character.isJavaIdentifierPart
|
||||
*/
|
||||
public fun Char.isJavaIdentifierStart(): Boolean = Character.isJavaIdentifierStart(this)
|
||||
|
||||
@Deprecated("Please use Char.isJavaIdentifierStart() instead")
|
||||
public fun Char.isJavaLetter(): Boolean = Character.isJavaLetter(this)
|
||||
|
||||
@Deprecated("Please use Char.isJavaIdentifierPart() instead")
|
||||
public fun Char.isJavaLetterOrDigit(): Boolean = Character.isJavaLetterOrDigit(this)
|
||||
|
||||
/**
|
||||
* Determines whether a character is whitespace according to the Unicode standard.
|
||||
* Returns `true` if the character is whitespace.
|
||||
|
||||
@@ -2,19 +2,6 @@
|
||||
@file:kotlin.jvm.JvmName("StandardKt")
|
||||
package kotlin
|
||||
|
||||
/**
|
||||
* Executes the given function [body] the number of times equal to the value of this integer.
|
||||
*/
|
||||
@Deprecated("Use repeat(n) { body } instead.")
|
||||
public inline fun Int.times(body : () -> Unit) {
|
||||
var count = this;
|
||||
while (count > 0) {
|
||||
body()
|
||||
count--
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Executes the given function [body] specified number of [times].
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user