diff --git a/core/src/main/kotlin/com/r3corda/core/Utils.kt b/core/src/main/kotlin/com/r3corda/core/Utils.kt index 4598e15a2a..ba6edf8d29 100644 --- a/core/src/main/kotlin/com/r3corda/core/Utils.kt +++ b/core/src/main/kotlin/com/r3corda/core/Utils.kt @@ -142,7 +142,7 @@ inline fun logElapsedTime(label: String, logger: Logger? = null, body: () -> * * val ii = state.locked { i } */ -class ThreadBox(content: T, val lock: ReentrantLock = ReentrantLock()) { +class ThreadBox(content: T, val lock: ReentrantLock = ReentrantLock()) { val content = content inline fun locked(body: T.() -> R): R = lock.withLock { body(content) } inline fun alreadyLocked(body: T.() -> R): R { @@ -164,7 +164,7 @@ abstract class RetryableException(message: String) : Exception(message) * will not be serialized to disk, and if it's missing (or the first time it's accessed), the initializer will be * used to set it up. Note that the initializer will be called with the TransientProperty object locked. */ -class TransientProperty(private val initializer: () -> T) { +class TransientProperty(private val initializer: () -> T) { @Transient private var v: T? = null @Synchronized diff --git a/core/src/main/kotlin/com/r3corda/core/contracts/Structures.kt b/core/src/main/kotlin/com/r3corda/core/contracts/Structures.kt index 774f14487b..28b293512b 100644 --- a/core/src/main/kotlin/com/r3corda/core/contracts/Structures.kt +++ b/core/src/main/kotlin/com/r3corda/core/contracts/Structures.kt @@ -132,7 +132,7 @@ interface IssuanceDefinition * * @param P the type of product underlying the definition, for example [Currency]. */ -data class Issued

( +data class Issued( val issuer: PartyAndReference, val product: P ) diff --git a/core/src/main/kotlin/com/r3corda/core/contracts/clauses/GroupClauseVerifier.kt b/core/src/main/kotlin/com/r3corda/core/contracts/clauses/GroupClauseVerifier.kt index 38bcf37262..2cdaf61f2b 100644 --- a/core/src/main/kotlin/com/r3corda/core/contracts/clauses/GroupClauseVerifier.kt +++ b/core/src/main/kotlin/com/r3corda/core/contracts/clauses/GroupClauseVerifier.kt @@ -6,7 +6,7 @@ import com.r3corda.core.contracts.ContractState import com.r3corda.core.contracts.TransactionForContract import java.util.* -interface GroupVerify { +interface GroupVerify { /** * * @return the set of commands that are consumed IF this clause is matched, and cannot be used to match a diff --git a/core/src/main/kotlin/com/r3corda/core/protocols/ProtocolLogic.kt b/core/src/main/kotlin/com/r3corda/core/protocols/ProtocolLogic.kt index c07cf36d86..5a79a4f4ca 100644 --- a/core/src/main/kotlin/com/r3corda/core/protocols/ProtocolLogic.kt +++ b/core/src/main/kotlin/com/r3corda/core/protocols/ProtocolLogic.kt @@ -24,7 +24,7 @@ import org.slf4j.Logger * If you'd like to use another ProtocolLogic class as a component of your own, construct it on the fly and then pass * it to the [subProtocol] method. It will return the result of that protocol when it completes. */ -abstract class ProtocolLogic { +abstract class ProtocolLogic { /** Reference to the [Fiber] instance that is the top level controller for the entire flow. */ lateinit var psm: ProtocolStateMachine<*> diff --git a/core/src/main/kotlin/com/r3corda/core/utilities/NonEmptySet.kt b/core/src/main/kotlin/com/r3corda/core/utilities/NonEmptySet.kt index a12b5c49c7..1e961f7539 100644 --- a/core/src/main/kotlin/com/r3corda/core/utilities/NonEmptySet.kt +++ b/core/src/main/kotlin/com/r3corda/core/utilities/NonEmptySet.kt @@ -72,7 +72,7 @@ class NonEmptySet(initial: T) : MutableSet { override fun hashCode(): Int = set.hashCode() override fun toString(): String = set.toString() - inner class Iterator(val iterator: MutableIterator) : MutableIterator { + inner class Iterator(val iterator: MutableIterator) : MutableIterator { override fun hasNext(): Boolean = iterator.hasNext() override fun next(): T = iterator.next() override fun remove() = diff --git a/core/src/main/kotlin/com/r3corda/core/utilities/RecordingMap.kt b/core/src/main/kotlin/com/r3corda/core/utilities/RecordingMap.kt index 4688518656..35f5b2765c 100644 --- a/core/src/main/kotlin/com/r3corda/core/utilities/RecordingMap.kt +++ b/core/src/main/kotlin/com/r3corda/core/utilities/RecordingMap.kt @@ -16,8 +16,8 @@ class RecordingMap(private val wrappedMap: MutableMap, // If/when Kotlin supports data classes inside sealed classes, that would be preferable to this. interface Record - data class Get(val key: K) : Record - data class Put(val key: K, val value: V) : Record + data class Get(val key: K) : Record + data class Put(val key: K, val value: V) : Record private val _records = Collections.synchronizedList(ArrayList()) diff --git a/core/src/main/kotlin/com/r3corda/core/utilities/UntrustworthyData.kt b/core/src/main/kotlin/com/r3corda/core/utilities/UntrustworthyData.kt index 9b94d7722e..cb450b0ce6 100644 --- a/core/src/main/kotlin/com/r3corda/core/utilities/UntrustworthyData.kt +++ b/core/src/main/kotlin/com/r3corda/core/utilities/UntrustworthyData.kt @@ -11,7 +11,7 @@ package com.r3corda.core.utilities * - Are any objects *reachable* from this object mismatched or not what you expected? * - Is it suspiciously large or small? */ -class UntrustworthyData(private val fromUntrustedWorld: T) { +class UntrustworthyData(private val fromUntrustedWorld: T) { val data: T @Deprecated("Accessing the untrustworthy data directly without validating it first is a bad idea") get() = fromUntrustedWorld diff --git a/core/src/main/kotlin/com/r3corda/protocols/FetchDataProtocol.kt b/core/src/main/kotlin/com/r3corda/protocols/FetchDataProtocol.kt index 48197eb970..f2269ae491 100644 --- a/core/src/main/kotlin/com/r3corda/protocols/FetchDataProtocol.kt +++ b/core/src/main/kotlin/com/r3corda/protocols/FetchDataProtocol.kt @@ -27,7 +27,7 @@ import java.util.* * @param T The ultimate type of the data being fetched. * @param W The wire type of the data being fetched, for when it isn't the same as the ultimate type. */ -abstract class FetchDataProtocol( +abstract class FetchDataProtocol( protected val requests: Set, protected val otherSide: Party) : ProtocolLogic>() { @@ -36,7 +36,7 @@ abstract class FetchDataProtocol( class DownloadedVsRequestedDataMismatch(val requested: SecureHash, val got: SecureHash) : BadAnswer() data class Request(val hashes: List, override val replyToParty: Party, override val sessionID: Long) : PartyRequestMessage - data class Result(val fromDisk: List, val downloaded: List) + data class Result(val fromDisk: List, val downloaded: List) @Suspendable override fun call(): Result { diff --git a/core/src/main/kotlin/com/r3corda/protocols/TwoPartyDealProtocol.kt b/core/src/main/kotlin/com/r3corda/protocols/TwoPartyDealProtocol.kt index b81cefa4f7..3429807fed 100644 --- a/core/src/main/kotlin/com/r3corda/protocols/TwoPartyDealProtocol.kt +++ b/core/src/main/kotlin/com/r3corda/protocols/TwoPartyDealProtocol.kt @@ -44,7 +44,7 @@ object TwoPartyDealProtocol { } // This object is serialised to the network and is the first protocol message the seller sends to the buyer. - data class Handshake( + data class Handshake( val payload: T, val publicKey: PublicKey, val sessionID: Long @@ -58,7 +58,7 @@ object TwoPartyDealProtocol { * There's a good chance we can push at least some of this logic down into core protocol logic * and helper methods etc. */ - abstract class Primary(override val progressTracker: ProgressTracker = Primary.tracker()) : ProtocolLogic() { + abstract class Primary(override val progressTracker: ProgressTracker = Primary.tracker()) : ProtocolLogic() { companion object { object AWAITING_PROPOSAL : ProgressTracker.Step("Handshaking and awaiting transaction proposal") diff --git a/core/src/main/kotlin/protocols/AbstractStateReplacementProtocol.kt b/core/src/main/kotlin/protocols/AbstractStateReplacementProtocol.kt index 1ae3e98408..a2a52e2d80 100644 --- a/core/src/main/kotlin/protocols/AbstractStateReplacementProtocol.kt +++ b/core/src/main/kotlin/protocols/AbstractStateReplacementProtocol.kt @@ -28,7 +28,7 @@ import java.security.PublicKey * use the new updated state for future transactions. */ abstract class AbstractStateReplacementProtocol { - interface Proposal { + interface Proposal { val stateRef: StateRef val modification: T val stx: SignedTransaction