Replaced sure() invocations with '!!' operator in libraries written on Kotlin.

This commit is contained in:
Evgeny Gerashchenko
2012-09-14 17:13:36 +04:00
parent 533cc5a04d
commit 8e1323bb43
47 changed files with 164 additions and 164 deletions
+2 -2
View File
@@ -105,7 +105,7 @@ class CollectionTest {
assertNull(x)
val f = data.find{it.startsWith("f")}
f.sure()
f!!
assertEquals("foo", f)
}
@@ -390,7 +390,7 @@ class CollectionTest {
private val collection = collection
override fun iterator(): Iterator<T> {
return collection.iterator().sure()
return collection.iterator()!!
}
}
}
+1 -1
View File
@@ -14,7 +14,7 @@ class TestBuilt<T>(name: String, val builder: TestBuilder<T>, val test: TestBuil
private var myState: T? = null
var state : T
get() = myState.sure()
get() = myState!!
set(newState: T) { myState = newState }
override fun countTestCases(): Int = 1
@@ -11,7 +11,7 @@ import java.util.concurrent.TimeUnit.*
class ThreadTest {
test fun scheduledTask() {
val pool = Executors.newFixedThreadPool(1).sure()
val pool = Executors.newFixedThreadPool(1)!!
val countDown = CountDownLatch(1)
pool {
countDown.countDown()
@@ -21,7 +21,7 @@ class ThreadTest {
test fun callableInvoke() {
val pool = Executors.newFixedThreadPool(1).sure()
val pool = Executors.newFixedThreadPool(1)!!
val future = pool<String> {
"Hello"
}
@@ -9,7 +9,7 @@ class IteratorsJVMTest {
test fun flatMapAndTakeExtractTheTransformedElements() {
fun intToBinaryDigits() = { (i: Int) ->
val binary = Integer.toBinaryString(i).sure()
val binary = Integer.toBinaryString(i)!!
var index = 0
iterate<Char> { if (index < binary.length()) binary.get(index++) else null }
}
+1 -1
View File
@@ -99,7 +99,7 @@ fun parseAtomic(tokens : Deque<Token>) : ParseResult<Expression> {
else
Failure("Expecting ')'")
}
is Number -> Success(Num(Integer.parseInt((token as Token).text).sure()))
is Number -> Success(Num(Integer.parseInt((token as Token).text)!!))
else -> Failure("Unexpected EOF")
}
}
@@ -13,11 +13,11 @@ class LocaleTemplateTest : TestCase() {
}
fun testFrance() : Unit {
format(LocaleFormatter(Locale.FRANCE.sure()))
format(LocaleFormatter(Locale.FRANCE!!))
}
fun testGermany() : Unit {
format(LocaleFormatter(Locale.GERMANY.sure()))
format(LocaleFormatter(Locale.GERMANY!!))
}
fun format(formatter: LocaleFormatter): Unit {