- Remove usages of deprecated methods

- Fix typos
- Fix other Kotlin warnings
This commit is contained in:
Viktor Kolomeyko 2017-08-15 15:08:54 +01:00 committed by Viktor Kolomeyko
parent ccdab6af4d
commit 88308a70c7
5 changed files with 9 additions and 8 deletions

View File

@ -19,6 +19,7 @@ import net.corda.core.messaging.RPCOps
import net.corda.core.serialization.SerializationContext
import net.corda.core.utilities.*
import net.corda.nodeapi.*
import org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration
import org.apache.activemq.artemis.api.core.SimpleString
import org.apache.activemq.artemis.api.core.client.ActiveMQClient.DEFAULT_ACK_BATCH_SIZE
import org.apache.activemq.artemis.api.core.client.ClientMessage
@ -164,7 +165,7 @@ class RPCClientProxyHandler(
TimeUnit.MILLISECONDS
)
sessionAndProducerPool.run {
it.session.createTemporaryQueue(clientAddress, clientAddress)
it.session.createTemporaryQueue(clientAddress, ActiveMQDefaultConfiguration.getDefaultRoutingType(), clientAddress)
}
val sessionFactory = serverLocator.createSessionFactory()
val session = sessionFactory.createSession(rpcUsername, rpcPassword, false, true, true, false, DEFAULT_ACK_BATCH_SIZE)

View File

@ -299,7 +299,7 @@ abstract class AbstractNode(open val configuration: NodeConfiguration,
.map { (initiatingFlow, initiatedFlows) ->
val sorted = initiatedFlows.sortedWith(FlowTypeHierarchyComparator(initiatingFlow))
if (sorted.size > 1) {
log.warn("${initiatingFlow.name} has been specified as the inititating flow by multiple flows " +
log.warn("${initiatingFlow.name} has been specified as the initiating flow by multiple flows " +
"in the same type hierarchy: ${sorted.joinToString { it.name }}. Choosing the most " +
"specific sub-type for registration: ${sorted[0].name}.")
}
@ -658,11 +658,11 @@ abstract class AbstractNode(open val configuration: NodeConfiguration,
.filterNotNull()
.toTypedArray()
val service = InMemoryIdentityService(setOf(info.legalIdentityAndCert), trustRoot = trustRoot, caCertificates = *caCertificates)
services.networkMapCache.partyNodes.forEach { service.registerIdentity(it.legalIdentityAndCert) }
services.networkMapCache.partyNodes.forEach { service.verifyAndRegisterIdentity(it.legalIdentityAndCert) }
services.networkMapCache.changed.subscribe { mapChange ->
// TODO how should we handle network map removal
if (mapChange is MapChange.Added) {
service.registerIdentity(mapChange.node.legalIdentityAndCert)
service.verifyAndRegisterIdentity(mapChange.node.legalIdentityAndCert)
}
}
return service

View File

@ -200,8 +200,8 @@ class TwoPartyTradeFlowTests {
val cashIssuer = bankNode.info.legalIdentity.ref(1)
val cpIssuer = bankNode.info.legalIdentity.ref(1, 2, 3)
aliceNode.services.identityService.registerIdentity(bobNode.info.legalIdentityAndCert)
bobNode.services.identityService.registerIdentity(aliceNode.info.legalIdentityAndCert)
aliceNode.services.identityService.verifyAndRegisterIdentity(bobNode.info.legalIdentityAndCert)
bobNode.services.identityService.verifyAndRegisterIdentity(aliceNode.info.legalIdentityAndCert)
aliceNode.disableDBCloseOnStop()
bobNode.disableDBCloseOnStop()

View File

@ -13,7 +13,7 @@ data class OGTrade(override val legalContractReference: SecureHash = SecureHash.
requireNotNull(tx.timeWindow) { "must have a time-window" }
val groups: List<LedgerTransaction.InOutGroup<IRSState, UniqueIdentifier>> = tx.groupStates { state -> state.linearId }
var atLeastOneCommandProcessed = false
for ((inputs, outputs, key) in groups) {
for ((inputs, outputs, _) in groups) {
val command = tx.commands.select<Commands.Agree>().firstOrNull()
if (command != null) {
require(inputs.isEmpty()) { "Inputs must be empty" }

View File

@ -13,7 +13,7 @@ data class PortfolioSwap(override val legalContractReference: SecureHash = Secur
override fun verify(tx: LedgerTransaction) {
requireNotNull(tx.timeWindow) { "must have a time-window)" }
val groups: List<LedgerTransaction.InOutGroup<PortfolioState, UniqueIdentifier>> = tx.groupStates { state -> state.linearId }
for ((inputs, outputs, key) in groups) {
for ((inputs, outputs, _) in groups) {
val agreeCommand = tx.commands.select<Commands.Agree>().firstOrNull()
if (agreeCommand != null) {
requireThat {