From 14f959b4afdd445b6092a821ff8ccea532409abf Mon Sep 17 00:00:00 2001
From: Tommy Lillehagen <tommy.lillehagen@r3.com>
Date: Fri, 6 Oct 2017 16:22:38 +0100
Subject: [PATCH] Code clean-up run

---
 .../net/corda/client/jfx/model/NetworkIdentityModel.kt   | 2 +-
 .../src/main/kotlin/net/corda/core/flows/FinalityFlow.kt | 2 +-
 .../net/corda/finance/contracts/JavaCommercialPaper.java | 4 +---
 .../net/corda/finance/contracts/asset/Obligation.kt      | 2 +-
 .../net/corda/finance/contracts/CommercialPaperTests.kt  | 3 ++-
 .../net/corda/finance/contracts/asset/CashTests.kt       | 7 ++++---
 .../internal/serialization/SerializationScheme.kt        | 2 +-
 .../internal/serialization/amqp/PropertySerializer.kt    | 6 +++---
 .../corda/node/services/network/NodeInfoWatcherTest.kt   | 2 +-
 .../node/services/statemachine/FlowStateMachineImpl.kt   | 2 +-
 .../net/corda/node/utilities/NonInvalidatingCache.kt     | 3 ---
 .../corda/node/utilities/NonInvalidatingUnboundCache.kt  | 3 ---
 .../resources/net/corda/node/shell/base/login.groovy     | 2 +-
 .../corda/node/services/vault/NodeVaultServiceTest.kt    | 5 +++--
 .../net/corda/node/services/vault/VaultWithCashTest.kt   | 9 +++++----
 .../src/main/kotlin/net/corda/irs/contract/IRSUtils.kt   | 1 -
 .../src/main/kotlin/net/corda/demobench/pty/R3Pty.kt     | 2 +-
 .../src/main/kotlin/net/corda/explorer/views/Network.kt  | 6 +++---
 .../main/kotlin/net/corda/explorer/views/SearchField.kt  | 2 +-
 .../kotlin/net/corda/explorer/views/TransactionViewer.kt | 4 ++--
 .../net/corda/explorer/views/cordapps/cash/CashViewer.kt | 2 +-
 21 files changed, 33 insertions(+), 38 deletions(-)

diff --git a/client/jfx/src/main/kotlin/net/corda/client/jfx/model/NetworkIdentityModel.kt b/client/jfx/src/main/kotlin/net/corda/client/jfx/model/NetworkIdentityModel.kt
index 9ff83660aa..2213d40bbc 100644
--- a/client/jfx/src/main/kotlin/net/corda/client/jfx/model/NetworkIdentityModel.kt
+++ b/client/jfx/src/main/kotlin/net/corda/client/jfx/model/NetworkIdentityModel.kt
@@ -38,7 +38,7 @@ class NetworkIdentityModel {
             })
 
     val notaries: ObservableList<Party> = networkIdentities.map {
-        it.legalIdentitiesAndCerts.find { it.name.commonName?.let { ServiceType.parse(it).isNotary() } ?: false }
+        it.legalIdentitiesAndCerts.find { it.name.commonName?.let { ServiceType.parse(it).isNotary() } == true }
     }.map { it?.party }.filterNotNull()
 
     val notaryNodes: ObservableList<NodeInfo> = notaries.map { rpcProxy.value?.nodeInfoFromParty(it) }.filterNotNull()
diff --git a/core/src/main/kotlin/net/corda/core/flows/FinalityFlow.kt b/core/src/main/kotlin/net/corda/core/flows/FinalityFlow.kt
index e2aafc165c..a08654acb9 100644
--- a/core/src/main/kotlin/net/corda/core/flows/FinalityFlow.kt
+++ b/core/src/main/kotlin/net/corda/core/flows/FinalityFlow.kt
@@ -88,7 +88,7 @@ class FinalityFlow(val transaction: SignedTransaction,
     private fun hasNoNotarySignature(stx: SignedTransaction): Boolean {
         val notaryKey = stx.tx.notary?.owningKey
         val signers = stx.sigs.map { it.by }.toSet()
-        return !(notaryKey?.isFulfilledBy(signers) ?: false)
+        return notaryKey?.isFulfilledBy(signers) != true
     }
 
     private fun getPartiesToSend(ltx: LedgerTransaction): Set<Party> {
diff --git a/finance/src/main/java/net/corda/finance/contracts/JavaCommercialPaper.java b/finance/src/main/java/net/corda/finance/contracts/JavaCommercialPaper.java
index 02bf2bbd45..221e02427c 100644
--- a/finance/src/main/java/net/corda/finance/contracts/JavaCommercialPaper.java
+++ b/finance/src/main/java/net/corda/finance/contracts/JavaCommercialPaper.java
@@ -101,9 +101,7 @@ public class JavaCommercialPaper implements Contract {
             if (issuance != null ? !issuance.equals(state.issuance) : state.issuance != null) return false;
             if (owner != null ? !owner.equals(state.owner) : state.owner != null) return false;
             if (faceValue != null ? !faceValue.equals(state.faceValue) : state.faceValue != null) return false;
-            if (maturityDate != null ? !maturityDate.equals(state.maturityDate) : state.maturityDate != null)
-                return false;
-            return true;
+            return maturityDate != null ? maturityDate.equals(state.maturityDate) : state.maturityDate == null;
         }
 
         @Override
diff --git a/finance/src/main/kotlin/net/corda/finance/contracts/asset/Obligation.kt b/finance/src/main/kotlin/net/corda/finance/contracts/asset/Obligation.kt
index e5d45f6d51..c30ddc0875 100644
--- a/finance/src/main/kotlin/net/corda/finance/contracts/asset/Obligation.kt
+++ b/finance/src/main/kotlin/net/corda/finance/contracts/asset/Obligation.kt
@@ -454,7 +454,7 @@ class Obligation<P : Any> : Contract {
 
                 requireThat {
                     "there is a time-window from the authority" using (timeWindow != null)
-                    "the due date has passed" using (timeWindow!!.fromTime?.isAfter(deadline) ?: false)
+                    "the due date has passed" using (timeWindow!!.fromTime?.isAfter(deadline) == true)
                     "input state lifecycle is correct" using (input.lifecycle == expectedInputLifecycle)
                     "output state corresponds exactly to input state, with lifecycle changed" using (expectedOutput == actualOutput)
                 }
diff --git a/finance/src/test/kotlin/net/corda/finance/contracts/CommercialPaperTests.kt b/finance/src/test/kotlin/net/corda/finance/contracts/CommercialPaperTests.kt
index a1a296eb05..9a8150ef0f 100644
--- a/finance/src/test/kotlin/net/corda/finance/contracts/CommercialPaperTests.kt
+++ b/finance/src/test/kotlin/net/corda/finance/contracts/CommercialPaperTests.kt
@@ -12,6 +12,7 @@ import net.corda.core.utilities.seconds
 import net.corda.finance.DOLLARS
 import net.corda.finance.`issued by`
 import net.corda.finance.contracts.asset.*
+import net.corda.finance.contracts.asset.Cash.Companion.generateSpend
 import net.corda.testing.*
 import net.corda.testing.contracts.fillWithSomeTestCash
 import net.corda.testing.node.MockServices
@@ -269,7 +270,7 @@ class CommercialPaperTestsGeneric {
             // Alice pays $9000 to BigCorp to own some of their debt.
             moveTX = run {
                 val builder = TransactionBuilder(DUMMY_NOTARY)
-                Cash.generateSpend(aliceServices, builder, 9000.DOLLARS, AnonymousParty(bigCorpServices.key.public))
+                generateSpend(aliceServices, builder, 9000.DOLLARS, AnonymousParty(bigCorpServices.key.public), ourIdentity, emptySet())
                 CommercialPaper().generateMove(builder, issueTx.tx.outRef(0), AnonymousParty(aliceServices.key.public))
                 val ptx = aliceServices.signInitialTransaction(builder)
                 val ptx2 = bigCorpServices.addSignature(ptx)
diff --git a/finance/src/test/kotlin/net/corda/finance/contracts/asset/CashTests.kt b/finance/src/test/kotlin/net/corda/finance/contracts/asset/CashTests.kt
index 952aa3d9df..e888d0705b 100644
--- a/finance/src/test/kotlin/net/corda/finance/contracts/asset/CashTests.kt
+++ b/finance/src/test/kotlin/net/corda/finance/contracts/asset/CashTests.kt
@@ -12,6 +12,7 @@ import net.corda.core.transactions.TransactionBuilder
 import net.corda.core.transactions.WireTransaction
 import net.corda.core.utilities.OpaqueBytes
 import net.corda.finance.*
+import net.corda.finance.contracts.asset.Cash.Companion.generateSpend
 import net.corda.finance.utils.sumCash
 import net.corda.finance.utils.sumCashBy
 import net.corda.finance.utils.sumCashOrNull
@@ -505,7 +506,7 @@ class CashTests : TestDependencyInjectionBase() {
     private fun makeSpend(amount: Amount<Currency>, dest: AbstractParty): WireTransaction {
         val tx = TransactionBuilder(DUMMY_NOTARY)
         database.transaction {
-            Cash.generateSpend(miniCorpServices, tx, amount, dest)
+            generateSpend(miniCorpServices, tx, amount, dest, ourIdentity, emptySet())
         }
         return tx.toWireTransaction(miniCorpServices)
     }
@@ -607,7 +608,7 @@ class CashTests : TestDependencyInjectionBase() {
         database.transaction {
 
             val tx = TransactionBuilder(DUMMY_NOTARY)
-            Cash.generateSpend(miniCorpServices, tx, 80.DOLLARS, ALICE, setOf(MINI_CORP))
+            generateSpend(miniCorpServices, tx, 80.DOLLARS, ALICE, ourIdentity, setOf(MINI_CORP))
 
             assertEquals(vaultStatesUnconsumed.elementAt(2).ref, tx.inputStates()[0])
         }
@@ -826,7 +827,7 @@ class CashTests : TestDependencyInjectionBase() {
                     PartyAndAmount(THEIR_IDENTITY_1, 400.DOLLARS),
                     PartyAndAmount(THEIR_IDENTITY_2, 150.DOLLARS)
             )
-            Cash.generateSpend(miniCorpServices, tx, payments)
+            generateSpend(miniCorpServices, tx, amount, to, ourIdentity, emptySet())
         }
         val wtx = tx.toWireTransaction(miniCorpServices)
         fun out(i: Int) = wtx.getOutput(i) as Cash.State
diff --git a/node-api/src/main/kotlin/net/corda/nodeapi/internal/serialization/SerializationScheme.kt b/node-api/src/main/kotlin/net/corda/nodeapi/internal/serialization/SerializationScheme.kt
index e4deaf2c55..1e7c257a1d 100644
--- a/node-api/src/main/kotlin/net/corda/nodeapi/internal/serialization/SerializationScheme.kt
+++ b/node-api/src/main/kotlin/net/corda/nodeapi/internal/serialization/SerializationScheme.kt
@@ -52,7 +52,7 @@ data class SerializationContextImpl(override val preferredSerializationVersion:
      * We need to cache the AttachmentClassLoaders to avoid too many contexts, since the class loader is part of cache key for the context.
      */
     override fun withAttachmentsClassLoader(attachmentHashes: List<SecureHash>): SerializationContext {
-        properties[attachmentsClassLoaderEnabledPropertyName] as? Boolean ?: false || return this
+        properties[attachmentsClassLoaderEnabledPropertyName] as? Boolean == true || return this
         val serializationContext = properties[serializationContextKey] as? SerializeAsTokenContextImpl ?: return this // Some tests don't set one.
         try {
             return withClassLoader(cache.get(attachmentHashes) {
diff --git a/node-api/src/main/kotlin/net/corda/nodeapi/internal/serialization/amqp/PropertySerializer.kt b/node-api/src/main/kotlin/net/corda/nodeapi/internal/serialization/amqp/PropertySerializer.kt
index feb06e123e..3d9fa8b0a5 100644
--- a/node-api/src/main/kotlin/net/corda/nodeapi/internal/serialization/amqp/PropertySerializer.kt
+++ b/node-api/src/main/kotlin/net/corda/nodeapi/internal/serialization/amqp/PropertySerializer.kt
@@ -21,8 +21,8 @@ sealed class PropertySerializer(val name: String, val readMethod: Method?, val r
     val default: String? = generateDefault()
     val mandatory: Boolean = generateMandatory()
 
-    private val isInterface: Boolean get() = resolvedType.asClass()?.isInterface ?: false
-    private val isJVMPrimitive: Boolean get() = resolvedType.asClass()?.isPrimitive ?: false
+    private val isInterface: Boolean get() = resolvedType.asClass()?.isInterface == true
+    private val isJVMPrimitive: Boolean get() = resolvedType.asClass()?.isPrimitive == true
 
     private fun generateType(): String {
         return if (isInterface || resolvedType == Any::class.java) "*" else SerializerFactory.nameForType(resolvedType)
@@ -45,7 +45,7 @@ sealed class PropertySerializer(val name: String, val readMethod: Method?, val r
     }
 
     private fun generateMandatory(): Boolean {
-        return isJVMPrimitive || !(readMethod?.returnsNullable() ?: true)
+        return isJVMPrimitive || readMethod?.returnsNullable() == false
     }
 
     private fun Method.returnsNullable(): Boolean {
diff --git a/node/src/integration-test/kotlin/net/corda/node/services/network/NodeInfoWatcherTest.kt b/node/src/integration-test/kotlin/net/corda/node/services/network/NodeInfoWatcherTest.kt
index 556e47cb50..268d23d394 100644
--- a/node/src/integration-test/kotlin/net/corda/node/services/network/NodeInfoWatcherTest.kt
+++ b/node/src/integration-test/kotlin/net/corda/node/services/network/NodeInfoWatcherTest.kt
@@ -35,7 +35,7 @@ class NodeInfoWatcherTest : NodeBasedTest() {
 
     lateinit var keyManagementService: KeyManagementService
     lateinit var nodeInfoPath: Path
-    val scheduler = TestScheduler();
+    val scheduler = TestScheduler()
     val testSubscriber = TestSubscriber<NodeInfo>()
 
     // Object under test
diff --git a/node/src/main/kotlin/net/corda/node/services/statemachine/FlowStateMachineImpl.kt b/node/src/main/kotlin/net/corda/node/services/statemachine/FlowStateMachineImpl.kt
index 0b478243f6..dea328709a 100644
--- a/node/src/main/kotlin/net/corda/node/services/statemachine/FlowStateMachineImpl.kt
+++ b/node/src/main/kotlin/net/corda/node/services/statemachine/FlowStateMachineImpl.kt
@@ -265,7 +265,7 @@ class FlowStateMachineImpl<R>(override val id: StateMachineRunId,
         // This is a hack to allow cash app access list of permitted issuer currency.
         // TODO: replace this with cordapp configuration.
         val config = serviceHub.configuration as? FullNodeConfiguration
-        val permissionGranted = config?.extraAdvertisedServiceIds?.contains(permissionName) ?: true
+        val permissionGranted = config?.extraAdvertisedServiceIds?.contains(permissionName) != false
         val checkPermissionEvent = FlowPermissionAuditEvent(
                 serviceHub.clock.instant(),
                 flowInitiator,
diff --git a/node/src/main/kotlin/net/corda/node/utilities/NonInvalidatingCache.kt b/node/src/main/kotlin/net/corda/node/utilities/NonInvalidatingCache.kt
index a81ce259e5..07dd16b936 100644
--- a/node/src/main/kotlin/net/corda/node/utilities/NonInvalidatingCache.kt
+++ b/node/src/main/kotlin/net/corda/node/utilities/NonInvalidatingCache.kt
@@ -27,8 +27,5 @@ class NonInvalidatingCache<K, V> private constructor(
         }
 
         override fun load(key: K) = loadFunction(key)
-        override fun loadAll(keys: Iterable<K>): MutableMap<K, V> {
-            return super.loadAll(keys)
-        }
     }
 }
\ No newline at end of file
diff --git a/node/src/main/kotlin/net/corda/node/utilities/NonInvalidatingUnboundCache.kt b/node/src/main/kotlin/net/corda/node/utilities/NonInvalidatingUnboundCache.kt
index 8719a4e448..ea16bfd064 100644
--- a/node/src/main/kotlin/net/corda/node/utilities/NonInvalidatingUnboundCache.kt
+++ b/node/src/main/kotlin/net/corda/node/utilities/NonInvalidatingUnboundCache.kt
@@ -29,8 +29,5 @@ class NonInvalidatingUnboundCache<K, V> private constructor(
         }
 
         override fun load(key: K) = loadFunction(key)
-        override fun loadAll(keys: Iterable<K>): MutableMap<K, V> {
-            return super.loadAll(keys)
-        }
     }
 }
\ No newline at end of file
diff --git a/node/src/main/resources/net/corda/node/shell/base/login.groovy b/node/src/main/resources/net/corda/node/shell/base/login.groovy
index 500704ae69..f6df32b386 100644
--- a/node/src/main/resources/net/corda/node/shell/base/login.groovy
+++ b/node/src/main/resources/net/corda/node/shell/base/login.groovy
@@ -11,5 +11,5 @@ Useful commands include 'help' to see what is available, and 'bye' to shut down
 """
 
 prompt = { ->
-    return "${new Date()}>>> ";
+    return "${new Date()}>>> "
 }
diff --git a/node/src/test/kotlin/net/corda/node/services/vault/NodeVaultServiceTest.kt b/node/src/test/kotlin/net/corda/node/services/vault/NodeVaultServiceTest.kt
index 5250e7f500..9d385d9663 100644
--- a/node/src/test/kotlin/net/corda/node/services/vault/NodeVaultServiceTest.kt
+++ b/node/src/test/kotlin/net/corda/node/services/vault/NodeVaultServiceTest.kt
@@ -20,6 +20,7 @@ import net.corda.core.utilities.OpaqueBytes
 import net.corda.core.utilities.toNonEmptySet
 import net.corda.finance.*
 import net.corda.finance.contracts.asset.Cash
+import net.corda.finance.contracts.asset.Cash.Companion.generateSpend
 import net.corda.finance.contracts.asset.DUMMY_CASH_ISSUER
 import net.corda.finance.contracts.asset.DUMMY_CASH_ISSUER_KEY
 import net.corda.finance.contracts.getCashBalance
@@ -515,7 +516,7 @@ class NodeVaultServiceTest : TestDependencyInjectionBase() {
 
         database.transaction {
             val moveTx = TransactionBuilder(services.myInfo.chooseIdentity()).apply {
-                Cash.generateSpend(services, this, Amount(1000, GBP), thirdPartyIdentity)
+                generateSpend(services, this, Amount(1000, GBP), thirdPartyIdentity, ourIdentity, emptySet())
             }.toWireTransaction(services)
             service.notify(moveTx)
         }
@@ -560,7 +561,7 @@ class NodeVaultServiceTest : TestDependencyInjectionBase() {
         // Move cash
         val moveTx = database.transaction {
             TransactionBuilder(newNotary).apply {
-                Cash.generateSpend(services, this, Amount(1000, GBP), thirdPartyIdentity)
+                generateSpend(services, this, Amount(1000, GBP), thirdPartyIdentity, ourIdentity, emptySet())
             }.toWireTransaction(services)
         }
 
diff --git a/node/src/test/kotlin/net/corda/node/services/vault/VaultWithCashTest.kt b/node/src/test/kotlin/net/corda/node/services/vault/VaultWithCashTest.kt
index 60e853d023..aacc46ce2b 100644
--- a/node/src/test/kotlin/net/corda/node/services/vault/VaultWithCashTest.kt
+++ b/node/src/test/kotlin/net/corda/node/services/vault/VaultWithCashTest.kt
@@ -12,6 +12,7 @@ import net.corda.core.node.services.vault.QueryCriteria.VaultQueryCriteria
 import net.corda.core.transactions.TransactionBuilder
 import net.corda.finance.*
 import net.corda.finance.contracts.asset.Cash
+import net.corda.finance.contracts.asset.Cash.Companion.generateSpend
 import net.corda.finance.contracts.asset.DUMMY_CASH_ISSUER
 import net.corda.finance.contracts.asset.DUMMY_CASH_ISSUER_KEY
 import net.corda.finance.contracts.getCashBalance
@@ -99,7 +100,7 @@ class VaultWithCashTest : TestDependencyInjectionBase() {
                 database.transaction {
                     // A tx that spends our money.
                     val spendTXBuilder = TransactionBuilder(DUMMY_NOTARY)
-                    Cash.generateSpend(services, spendTXBuilder, 80.DOLLARS, BOB)
+                    generateSpend(services, spendTXBuilder, 80.DOLLARS, BOB, ourIdentity, emptySet())
                     val spendPTX = services.signInitialTransaction(spendTXBuilder, freshKey)
                     notaryServices.addSignature(spendPTX)
                 }
@@ -151,7 +152,7 @@ class VaultWithCashTest : TestDependencyInjectionBase() {
             database.transaction {
                 try {
                     val txn1Builder = TransactionBuilder(DUMMY_NOTARY)
-                    Cash.generateSpend(services, txn1Builder, 60.DOLLARS, BOB)
+                    generateSpend(services, txn1Builder, 60.DOLLARS, BOB, ourIdentity, emptySet())
                     val ptxn1 = notaryServices.signInitialTransaction(txn1Builder)
                     val txn1 = services.addSignature(ptxn1, freshKey)
                     println("txn1: ${txn1.id} spent ${((txn1.tx.outputs[0].data) as Cash.State).amount}")
@@ -187,7 +188,7 @@ class VaultWithCashTest : TestDependencyInjectionBase() {
             database.transaction {
                 try {
                     val txn2Builder = TransactionBuilder(DUMMY_NOTARY)
-                    Cash.generateSpend(services, txn2Builder, 80.DOLLARS, BOB)
+                    generateSpend(services, txn2Builder, 80.DOLLARS, BOB, ourIdentity, emptySet())
                     val ptxn2 = notaryServices.signInitialTransaction(txn2Builder)
                     val txn2 = services.addSignature(ptxn2, freshKey)
                     println("txn2: ${txn2.id} spent ${((txn2.tx.outputs[0].data) as Cash.State).amount}")
@@ -311,7 +312,7 @@ class VaultWithCashTest : TestDependencyInjectionBase() {
         database.transaction {
             // A tx that spends our money.
             val spendTXBuilder = TransactionBuilder(DUMMY_NOTARY)
-            Cash.generateSpend(services, spendTXBuilder, 80.DOLLARS, BOB)
+            generateSpend(services, spendTXBuilder, 80.DOLLARS, BOB, ourIdentity, emptySet())
             val spendPTX = notaryServices.signInitialTransaction(spendTXBuilder)
             val spendTX = services.addSignature(spendPTX, freshKey)
             services.recordTransactions(spendTX)
diff --git a/samples/irs-demo/src/main/kotlin/net/corda/irs/contract/IRSUtils.kt b/samples/irs-demo/src/main/kotlin/net/corda/irs/contract/IRSUtils.kt
index fb7e367a3c..c362e602a5 100644
--- a/samples/irs-demo/src/main/kotlin/net/corda/irs/contract/IRSUtils.kt
+++ b/samples/irs-demo/src/main/kotlin/net/corda/irs/contract/IRSUtils.kt
@@ -71,7 +71,6 @@ class FixedRate(ratioUnit: RatioUnit) : Rate(ratioUnit) {
     fun isPositive(): Boolean = ratioUnit!!.value > BigDecimal("0.0")
 
     override fun equals(other: Any?) = other?.javaClass == javaClass && super.equals(other)
-    override fun hashCode() = super.hashCode()
 }
 
 /**
diff --git a/tools/demobench/src/main/kotlin/net/corda/demobench/pty/R3Pty.kt b/tools/demobench/src/main/kotlin/net/corda/demobench/pty/R3Pty.kt
index afc91bb6f4..cd82181367 100644
--- a/tools/demobench/src/main/kotlin/net/corda/demobench/pty/R3Pty.kt
+++ b/tools/demobench/src/main/kotlin/net/corda/demobench/pty/R3Pty.kt
@@ -21,7 +21,7 @@ class R3Pty(val name: CordaX500Name, settings: SettingsProvider, dimension: Dime
 
     val terminal = JediTermWidget(dimension, settings)
 
-    val isConnected: Boolean get() = terminal.ttyConnector?.isConnected ?: false
+    val isConnected: Boolean get() = terminal.ttyConnector?.isConnected == true
 
     override fun close() {
         log.info("Closing terminal '{}'", name)
diff --git a/tools/explorer/src/main/kotlin/net/corda/explorer/views/Network.kt b/tools/explorer/src/main/kotlin/net/corda/explorer/views/Network.kt
index cb7f69df1f..de6a41aded 100644
--- a/tools/explorer/src/main/kotlin/net/corda/explorer/views/Network.kt
+++ b/tools/explorer/src/main/kotlin/net/corda/explorer/views/Network.kt
@@ -103,7 +103,7 @@ class Network : CordaView() {
                     hgap = 5.0
                     vgap = 5.0
                     for (identity in identities) {
-                        val isNotary = identity.name.commonName?.let { ServiceType.parse(it).isNotary() } ?: false
+                        val isNotary = identity.name.commonName?.let { ServiceType.parse(it).isNotary() } == true
                         row("${if (isNotary) "Notary " else ""}Public Key :") {
                             copyableLabel(SimpleObjectProperty(identity.owningKey.toBase58String()))
                         }
@@ -150,7 +150,7 @@ class Network : CordaView() {
     }
 
     override fun onDock() {
-        centralLabel = mapLabels.firstOrDefault(SimpleObjectProperty(myLabel), { centralPeer?.contains(it.text, true) ?: false })
+        centralLabel = mapLabels.firstOrDefault(SimpleObjectProperty(myLabel), { centralPeer?.contains(it.text, true) == true })
         centralLabel.value?.let { mapScrollPane.centerLabel(it) }
     }
 
@@ -160,7 +160,7 @@ class Network : CordaView() {
     }
 
     init {
-        centralLabel = mapLabels.firstOrDefault(SimpleObjectProperty(myLabel), { centralPeer?.contains(it.text, true) ?: false })
+        centralLabel = mapLabels.firstOrDefault(SimpleObjectProperty(myLabel), { centralPeer?.contains(it.text, true) == true })
         Bindings.bindContent(notaryList.children, notaryButtons)
         Bindings.bindContent(peerList.children, peerButtons)
         // Run once when the screen is ready.
diff --git a/tools/explorer/src/main/kotlin/net/corda/explorer/views/SearchField.kt b/tools/explorer/src/main/kotlin/net/corda/explorer/views/SearchField.kt
index 2feeb8a938..ce06f65318 100644
--- a/tools/explorer/src/main/kotlin/net/corda/explorer/views/SearchField.kt
+++ b/tools/explorer/src/main/kotlin/net/corda/explorer/views/SearchField.kt
@@ -37,7 +37,7 @@ class SearchField<T>(private val data: ObservableList<T>, vararg filterCriteria:
             text.isNullOrBlank() || if (category == ALL) {
                 filterCriteria.any { it.second(data, text) }
             } else {
-                filterCriteria.toMap()[category]?.invoke(data, text) ?: false
+                filterCriteria.toMap()[category]?.invoke(data, text) == true
             }
         }
     }, arrayOf<Observable>(textField.textProperty(), searchCategory.valueProperty())))
diff --git a/tools/explorer/src/main/kotlin/net/corda/explorer/views/TransactionViewer.kt b/tools/explorer/src/main/kotlin/net/corda/explorer/views/TransactionViewer.kt
index f528e0ec66..128c2f221b 100644
--- a/tools/explorer/src/main/kotlin/net/corda/explorer/views/TransactionViewer.kt
+++ b/tools/explorer/src/main/kotlin/net/corda/explorer/views/TransactionViewer.kt
@@ -135,8 +135,8 @@ class TransactionViewer : CordaView("Transactions") {
                 "Transaction ID" to { tx, s -> "${tx.id}".contains(s, true) },
                 "Input" to { tx, s -> tx.inputs.resolved.any { it.state.contract.contains(s, true) } },
                 "Output" to { tx, s -> tx.outputs.any { it.state.contract.contains(s, true) } },
-                "Input Party" to { tx, s -> tx.inputParties.any { it.any { it.value?.name?.organisation?.contains(s, true) ?: false } } },
-                "Output Party" to { tx, s -> tx.outputParties.any { it.any { it.value?.name?.organisation?.contains(s, true) ?: false } } },
+                "Input Party" to { tx, s -> tx.inputParties.any { it.any { it.value?.name?.organisation?.contains(s, true) == true } } },
+                "Output Party" to { tx, s -> tx.outputParties.any { it.any { it.value?.name?.organisation?.contains(s, true) == true } } },
                 "Command Type" to { tx, s -> tx.commandTypes.any { it.simpleName.contains(s, true) } }
         )
         root.top = searchField.root
diff --git a/tools/explorer/src/main/kotlin/net/corda/explorer/views/cordapps/cash/CashViewer.kt b/tools/explorer/src/main/kotlin/net/corda/explorer/views/cordapps/cash/CashViewer.kt
index 480ae1116e..6093a235b1 100644
--- a/tools/explorer/src/main/kotlin/net/corda/explorer/views/cordapps/cash/CashViewer.kt
+++ b/tools/explorer/src/main/kotlin/net/corda/explorer/views/cordapps/cash/CashViewer.kt
@@ -147,7 +147,7 @@ class CashViewer : CordaView("Cash") {
          */
         val searchField = SearchField(cashStates,
                 "Currency" to { state, text -> state.state.data.amount.token.product.toString().contains(text, true) },
-                "Issuer" to { state, text -> state.resolveIssuer().value?.name?.organisation?.contains(text, true) ?: false }
+                "Issuer" to { state, text -> state.resolveIssuer().value?.name?.organisation?.contains(text, true) == true }
         )
         root.top = hbox(5.0) {
             button("New Transaction", FontAwesomeIconView(FontAwesomeIcon.PLUS)) {