From aaaf6ea4f6e3e759715d933e59537576d7a94e3c Mon Sep 17 00:00:00 2001 From: Ross Nicoll Date: Wed, 27 Jul 2016 17:11:27 +0100 Subject: [PATCH] Correct warnings --- .../com/r3corda/node/services/statemachine/FiberRequest.kt | 4 ++++ .../services/persistence/PerFileCheckpointStorageTests.kt | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/node/src/main/kotlin/com/r3corda/node/services/statemachine/FiberRequest.kt b/node/src/main/kotlin/com/r3corda/node/services/statemachine/FiberRequest.kt index 1b1ac5b9ad..d088df8c74 100644 --- a/node/src/main/kotlin/com/r3corda/node/services/statemachine/FiberRequest.kt +++ b/node/src/main/kotlin/com/r3corda/node/services/statemachine/FiberRequest.kt @@ -68,6 +68,10 @@ sealed class FiberRequest(val topic: String, override fun toString(): String { 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 get() = Class.forName(responseTypeName) as Class } diff --git a/node/src/test/kotlin/com/r3corda/node/services/persistence/PerFileCheckpointStorageTests.kt b/node/src/test/kotlin/com/r3corda/node/services/persistence/PerFileCheckpointStorageTests.kt index 6af826b8ba..247b2f9ae5 100644 --- a/node/src/test/kotlin/com/r3corda/node/services/persistence/PerFileCheckpointStorageTests.kt +++ b/node/src/test/kotlin/com/r3corda/node/services/persistence/PerFileCheckpointStorageTests.kt @@ -96,7 +96,7 @@ class PerFileCheckpointStorageTests { private var checkpointCount = 1 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) } \ No newline at end of file