remove some unnecessary !! from stdlib
This commit is contained in:
@@ -6,10 +6,10 @@ import java.util.concurrent.Future
|
||||
import java.util.concurrent.Callable
|
||||
|
||||
inline val currentThread : Thread
|
||||
get() = Thread.currentThread()!!
|
||||
get() = Thread.currentThread()
|
||||
|
||||
inline var Thread.name : String
|
||||
get() = getName()!!
|
||||
get() = getName()
|
||||
set(name: String) { setName(name) }
|
||||
|
||||
inline var Thread.daemon : Boolean
|
||||
@@ -66,7 +66,7 @@ public inline fun Executor.invoke(action: ()->Unit) {
|
||||
*/
|
||||
public inline fun <T>ExecutorService.submit(action: ()->T):Future<T> {
|
||||
val c:Callable<T> = callable(action)
|
||||
return submit(c)!!;
|
||||
return submit(c);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -129,7 +129,7 @@ public inline fun <T> T?.makeString(separator: String = ", ", prefix: String = "
|
||||
buffer.append(this)
|
||||
}
|
||||
buffer.append(postfix)
|
||||
return buffer.toString()!!
|
||||
return buffer.toString()
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ class CompositeIterator<T>(vararg iterators: Iterator<T>): AbstractIterator<T>()
|
||||
val iter = currentIter
|
||||
if (iter != null) {
|
||||
if (iter.hasNext()) {
|
||||
setNext(iter.next()!!)
|
||||
setNext(iter.next())
|
||||
return
|
||||
} else {
|
||||
currentIter = null
|
||||
|
||||
@@ -116,7 +116,7 @@ public open class ToStringFormatter : Formatter {
|
||||
}
|
||||
}
|
||||
|
||||
public val defaultLocale : Locale = Locale.getDefault()!!
|
||||
public val defaultLocale : Locale = Locale.getDefault()
|
||||
|
||||
/**
|
||||
* Formats values using a given [[Locale]] for internationalisation
|
||||
|
||||
Reference in New Issue
Block a user