From cd7d01917f5591d1baeac2dfe43a60b6efa0e337 Mon Sep 17 00:00:00 2001 From: Mike Hearn Date: Thu, 24 Dec 2015 17:21:10 +0000 Subject: [PATCH] Kotlin 1.0.0-beta-4584 --- build.gradle | 3 ++- src/main/kotlin/contracts/JavaCommercialPaper.java | 2 +- src/main/kotlin/core/Transactions.kt | 2 +- src/main/kotlin/core/messaging/InMemoryNetwork.kt | 3 +-- src/main/kotlin/core/serialization/ByteArrays.kt | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/build.gradle b/build.gradle index f681dbf1d2..96954659f5 100644 --- a/build.gradle +++ b/build.gradle @@ -11,7 +11,7 @@ allprojects { } buildscript { - ext.kotlin_version = '1.0.0-beta-3594' + ext.kotlin_version = '1.0.0-beta-4584' repositories { mavenCentral() jcenter() @@ -34,6 +34,7 @@ dependencies { testCompile 'junit:junit:4.11' compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" compile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" + compile "org.jetbrains.kotlin:kotlin-test:$kotlin_version" compile "com.google.guava:guava:18.0" compile "com.esotericsoftware:kryo:3.0.3" compile "de.javakaffee:kryo-serializers:0.37" diff --git a/src/main/kotlin/contracts/JavaCommercialPaper.java b/src/main/kotlin/contracts/JavaCommercialPaper.java index 3a7a0027ca..0cd749e5c8 100644 --- a/src/main/kotlin/contracts/JavaCommercialPaper.java +++ b/src/main/kotlin/contracts/JavaCommercialPaper.java @@ -17,7 +17,7 @@ import java.time.*; import java.util.*; import static core.ContractsDSLKt.*; -import static kotlin.CollectionsKt.*; +import static kotlin.collections.CollectionsKt.*; /** * This is a Java version of the CommercialPaper contract (chosen because it's simple). This demonstrates how the diff --git a/src/main/kotlin/core/Transactions.kt b/src/main/kotlin/core/Transactions.kt index 03fd2d2822..46379aa3b2 100644 --- a/src/main/kotlin/core/Transactions.kt +++ b/src/main/kotlin/core/Transactions.kt @@ -65,7 +65,7 @@ data class SignedWireTransaction(val txBits: SerializedBytes, v init { check(sigs.isNotEmpty()) } // Lazily calculated access to the deserialised/hashed transaction data. - @Transient val tx: WireTransaction by lazy { txBits.deserialize() } + val tx: WireTransaction by lazy { txBits.deserialize() } /** A transaction ID is the hash of the [WireTransaction]. Thus adding or removing a signature does not change it. */ val id: SecureHash get() = txBits.hash diff --git a/src/main/kotlin/core/messaging/InMemoryNetwork.kt b/src/main/kotlin/core/messaging/InMemoryNetwork.kt index 7f8b65af22..65c5558ffc 100644 --- a/src/main/kotlin/core/messaging/InMemoryNetwork.kt +++ b/src/main/kotlin/core/messaging/InMemoryNetwork.kt @@ -20,7 +20,6 @@ import javax.annotation.concurrent.GuardedBy import javax.annotation.concurrent.ThreadSafe import kotlin.concurrent.currentThread import kotlin.concurrent.thread -import kotlin.test.fail /** * An in-memory network allows you to manufacture [Node]s for a set of participants. Each @@ -73,7 +72,7 @@ public class InMemoryNetwork { for (handle in networkMap.keys) getQueueForHandle(handle).add(message) } - else -> fail("Unknown type of recipient handle") + else -> throw IllegalArgumentException("Unknown type of recipient handle") } } diff --git a/src/main/kotlin/core/serialization/ByteArrays.kt b/src/main/kotlin/core/serialization/ByteArrays.kt index 07724ca8d2..449fc280a7 100644 --- a/src/main/kotlin/core/serialization/ByteArrays.kt +++ b/src/main/kotlin/core/serialization/ByteArrays.kt @@ -38,7 +38,7 @@ open class OpaqueBytes(val bits: ByteArray) { } class SerializedBytes(bits: ByteArray) : OpaqueBytes(bits) { - @Transient val hash: SecureHash by lazy { bits.sha256() } + val hash: SecureHash by lazy { bits.sha256() } } fun ByteArray.opaque(): OpaqueBytes = OpaqueBytes(this)