Merged in rnicoll-warnings (pull request #246)

Correct warnings
This commit is contained in:
Ross Nicoll 2016-07-28 13:03:55 +01:00
commit ec726da7d0
2 changed files with 5 additions and 1 deletions

View File

@ -68,6 +68,10 @@ sealed class FiberRequest(val topic: String,
override fun toString(): String { override fun toString(): String {
return "Expecting response via topic ${receiveTopic} of type ${responseTypeName}" return "Expecting response via topic ${receiveTopic} of type ${responseTypeName}"
} }
// We have to do an unchecked cast, but unless the serialized form is damaged, this was
// correct when the request was instantiated
@Suppress("UNCHECKED_CAST")
val responseType: Class<R> val responseType: Class<R>
get() = Class.forName(responseTypeName) as Class<R> get() = Class.forName(responseTypeName) as Class<R>
} }

View File

@ -96,7 +96,7 @@ class PerFileCheckpointStorageTests {
private var checkpointCount = 1 private var checkpointCount = 1
private val request = FiberRequest.ExpectingResponse("topic", null, random63BitValue(), random63BitValue(), null, private val request = FiberRequest.ExpectingResponse("topic", null, random63BitValue(), random63BitValue(), null,
java.lang.String::class.java) kotlin.String::class.java)
private fun newCheckpoint() = Checkpoint(SerializedBytes(Ints.toByteArray(checkpointCount++)), request) private fun newCheckpoint() = Checkpoint(SerializedBytes(Ints.toByteArray(checkpointCount++)), request)
} }