Suppress or fix the few remaining compiler warnings

This commit is contained in:
Mike Hearn 2016-11-25 15:09:27 +01:00
parent a79072bdf9
commit 7b2eb651be
5 changed files with 8 additions and 7 deletions

View File

@ -112,7 +112,6 @@ class NodeVaultServiceTest {
services.vaultService.addNoteToTransaction(usefulTX.id, "USD Sample Note 1") services.vaultService.addNoteToTransaction(usefulTX.id, "USD Sample Note 1")
services.vaultService.addNoteToTransaction(usefulTX.id, "USD Sample Note 2") services.vaultService.addNoteToTransaction(usefulTX.id, "USD Sample Note 2")
services.vaultService.addNoteToTransaction(usefulTX.id, "USD Sample Note 3") services.vaultService.addNoteToTransaction(usefulTX.id, "USD Sample Note 3")
val results = services.vaultService.getTransactionNotes(usefulTX.id)
assertEquals(3, services.vaultService.getTransactionNotes(usefulTX.id).count()) assertEquals(3, services.vaultService.getTransactionNotes(usefulTX.id).count())
// Issue more Money (GBP) // Issue more Money (GBP)

View File

@ -118,6 +118,7 @@ class IRSSimulation(networkSendManuallyPumped: Boolean, runAsync: Boolean, laten
irs.fixedLeg.fixedRatePayer = node1.info.legalIdentity irs.fixedLeg.fixedRatePayer = node1.info.legalIdentity
irs.floatingLeg.floatingRatePayer = node2.info.legalIdentity irs.floatingLeg.floatingRatePayer = node2.info.legalIdentity
@Suppress("UNCHECKED_CAST")
val acceptorTx = node2.initiateSingleShotFlow(Instigator::class) { Acceptor(it) }.flatMap { val acceptorTx = node2.initiateSingleShotFlow(Instigator::class) { Acceptor(it) }.flatMap {
(it.fsm as FlowStateMachine<SignedTransaction>).resultFuture (it.fsm as FlowStateMachine<SignedTransaction>).resultFuture
} }

View File

@ -50,6 +50,7 @@ class TradeSimulation(runAsync: Boolean, latencyInjector: InMemoryMessagingNetwo
val amount = 1000.DOLLARS val amount = 1000.DOLLARS
@Suppress("UNCHECKED_CAST")
val buyerFuture = buyer.initiateSingleShotFlow(Seller::class) { val buyerFuture = buyer.initiateSingleShotFlow(Seller::class) {
Buyer(it, notary.info.notaryIdentity, amount, CommercialPaper.State::class.java) Buyer(it, notary.info.notaryIdentity, amount, CommercialPaper.State::class.java)
}.flatMap { (it.fsm as FlowStateMachine<SignedTransaction>).resultFuture } }.flatMap { (it.fsm as FlowStateMachine<SignedTransaction>).resultFuture }

View File

@ -6,6 +6,7 @@
* *
* Please see distribution for license. * Please see distribution for license.
*/ */
package net.corda.vega.analytics.example package net.corda.vega.analytics.example
import com.google.common.collect.ImmutableList import com.google.common.collect.ImmutableList
@ -52,7 +53,7 @@ import java.time.LocalDate
fun main(args: Array<String>) { fun main(args: Array<String>) {
val swapPricingExample = SwapPricingExample() val swapPricingExample = SwapPricingExample()
swapPricingExample.main(args) swapPricingExample.main()
} }
/** /**
@ -64,13 +65,10 @@ fun testOGTradeContract() {
} }
class SwapPricingExample { class SwapPricingExample {
/** /**
* Runs the example, pricing the instruments, producing the output as an ASCII table. * Runs the example, pricing the instruments, producing the output as an ASCII table.
* @param args ignored
*/ */
fun main(args: Array<String>) { fun main() {
// setup calculation runner component, which needs life-cycle management // setup calculation runner component, which needs life-cycle management
// a typical application might use dependency injection to obtain the instance // a typical application might use dependency injection to obtain the instance
val runner = CalculationRunner.ofMultiThreaded() val runner = CalculationRunner.ofMultiThreaded()

View File

@ -5,8 +5,8 @@ import net.corda.core.contracts.StateAndRef
import net.corda.core.contracts.StateRef import net.corda.core.contracts.StateRef
import net.corda.core.contracts.TransactionState import net.corda.core.contracts.TransactionState
import net.corda.core.crypto.Party import net.corda.core.crypto.Party
import net.corda.core.sum
import net.corda.core.node.ServiceHub import net.corda.core.node.ServiceHub
import net.corda.core.sum
import net.corda.vega.contracts.IRSState import net.corda.vega.contracts.IRSState
import net.corda.vega.contracts.SwapData import net.corda.vega.contracts.SwapData
import java.time.LocalDate import java.time.LocalDate
@ -34,6 +34,8 @@ fun List<StateAndRef<IRSState>>.toPortfolio(): Portfolio {
return Portfolio(this) return Portfolio(this)
} }
// TODO: This should probably have its generics fixed and moved into the core platform API.
@Suppress("UNCHECKED_CAST")
fun <T : ContractState> List<StateRef>.toStateAndRef(services: ServiceHub): List<StateAndRef<T>> { fun <T : ContractState> List<StateRef>.toStateAndRef(services: ServiceHub): List<StateAndRef<T>> {
return services.vaultService.statesForRefs(this).map { return services.vaultService.statesForRefs(this).map {
StateAndRef(it.value as TransactionState<T>, it.key) StateAndRef(it.value as TransactionState<T>, it.key)