From d2ebcbfab0866a5eb0d9cfb76b2cf7bb8711abac Mon Sep 17 00:00:00 2001 From: Clinton Alexander Date: Mon, 30 Jan 2017 12:05:22 +0000 Subject: [PATCH] Fixed whitespace and formatting with IntelliJ autoformat tool. --- docs/source/corda-plugins.rst | 2 +- node/src/main/kotlin/net/corda/node/Corda.kt | 2 +- .../kotlin/net/corda/node/webserver/WebServer.kt | 12 ++++++------ .../net/corda/bank/BankOfCordaRPCClientTest.kt | 5 ++--- .../kotlin/net/corda/irs/api/NodeInterestRates.kt | 6 ++++-- .../kotlin/net/corda/simulation/IRSSimulation.kt | 2 -- .../kotlin/net/corda/traderdemo/TraderDemoTest.kt | 9 ++++----- 7 files changed, 18 insertions(+), 20 deletions(-) diff --git a/docs/source/corda-plugins.rst b/docs/source/corda-plugins.rst index 551782b797..33cb79d963 100644 --- a/docs/source/corda-plugins.rst +++ b/docs/source/corda-plugins.rst @@ -35,7 +35,7 @@ extensions to be created, or registered at startup. In particular: a. The ``webApis`` property is a list of JAX-RS annotated REST access classes. These classes will be constructed by the bundled web server - and must have a single argument constructor taking a ``CordaRpcOps`` + and must have a single argument constructor taking a ``CordaRPCOps`` reference. This will allow it to communicate with the node process via the RPC interface. These web APIs will not be available if the bundled web server is not started. diff --git a/node/src/main/kotlin/net/corda/node/Corda.kt b/node/src/main/kotlin/net/corda/node/Corda.kt index 2e908c6861..b1e421cd4b 100644 --- a/node/src/main/kotlin/net/corda/node/Corda.kt +++ b/node/src/main/kotlin/net/corda/node/Corda.kt @@ -89,7 +89,7 @@ fun main(args: Array) { try { cmdlineOptions.baseDirectory.createDirectories() - if(!cmdlineOptions.isWebserver) { + if (!cmdlineOptions.isWebserver) { val node = conf.createNode() node.start() printPluginsAndServices(node) diff --git a/node/src/main/kotlin/net/corda/node/webserver/WebServer.kt b/node/src/main/kotlin/net/corda/node/webserver/WebServer.kt index 7278bcc2f8..d5d994f05b 100644 --- a/node/src/main/kotlin/net/corda/node/webserver/WebServer.kt +++ b/node/src/main/kotlin/net/corda/node/webserver/WebServer.kt @@ -7,11 +7,11 @@ import net.corda.node.printBasicNodeInfo import net.corda.node.services.config.FullNodeConfiguration import net.corda.node.services.messaging.ArtemisMessagingComponent import net.corda.node.services.messaging.CordaRPCClient -import net.corda.node.webserver.servlets.AttachmentDownloadServlet -import net.corda.node.webserver.servlets.ObjectMapperConfig -import net.corda.node.webserver.servlets.DataUploadServlet -import net.corda.node.webserver.servlets.ResponseFilter import net.corda.node.webserver.internal.APIServerImpl +import net.corda.node.webserver.servlets.AttachmentDownloadServlet +import net.corda.node.webserver.servlets.DataUploadServlet +import net.corda.node.webserver.servlets.ObjectMapperConfig +import net.corda.node.webserver.servlets.ResponseFilter import org.apache.activemq.artemis.api.core.ActiveMQNotConnectedException import org.eclipse.jetty.server.* import org.eclipse.jetty.server.handler.HandlerCollection @@ -42,7 +42,7 @@ class WebServer(val config: FullNodeConfiguration) { } fun run() { - while(server.isRunning) { + while (server.isRunning) { Thread.sleep(100) // TODO: Redesign } } @@ -153,7 +153,7 @@ class WebServer(val config: FullNodeConfiguration) { } private fun retryConnectLocalRpc(): CordaRPCOps { - while(true) { + while (true) { try { return connectLocalRpcAsNodeUser() } catch (e: ActiveMQNotConnectedException) { diff --git a/samples/bank-of-corda-demo/src/integration-test/kotlin/net/corda/bank/BankOfCordaRPCClientTest.kt b/samples/bank-of-corda-demo/src/integration-test/kotlin/net/corda/bank/BankOfCordaRPCClientTest.kt index dd2e0ca911..5337fface2 100644 --- a/samples/bank-of-corda-demo/src/integration-test/kotlin/net/corda/bank/BankOfCordaRPCClientTest.kt +++ b/samples/bank-of-corda-demo/src/integration-test/kotlin/net/corda/bank/BankOfCordaRPCClientTest.kt @@ -14,7 +14,6 @@ import net.corda.node.services.transactions.SimpleNotaryService import net.corda.testing.BOC_PARTY_REF import net.corda.testing.expect import net.corda.testing.expectEvents -import net.corda.node.utilities.getHostAndPort import net.corda.testing.sequence import org.junit.Test import kotlin.test.assertTrue @@ -25,8 +24,8 @@ class BankOfCordaRPCClientTest { driver(dsl = { val user = User("user1", "test", permissions = setOf(startFlowPermission())) val (nodeBankOfCorda, nodeBigCorporation) = Futures.allAsList( - startNode("BankOfCorda", setOf(ServiceInfo(SimpleNotaryService.type)), listOf(user)), - startNode("BigCorporation", rpcUsers = listOf(user)) + startNode("BankOfCorda", setOf(ServiceInfo(SimpleNotaryService.type)), listOf(user)), + startNode("BigCorporation", rpcUsers = listOf(user)) ).getOrThrow() // Bank of Corda RPC Client diff --git a/samples/irs-demo/src/main/kotlin/net/corda/irs/api/NodeInterestRates.kt b/samples/irs-demo/src/main/kotlin/net/corda/irs/api/NodeInterestRates.kt index 83a46c3e3f..b172a9768d 100644 --- a/samples/irs-demo/src/main/kotlin/net/corda/irs/api/NodeInterestRates.kt +++ b/samples/irs-demo/src/main/kotlin/net/corda/irs/api/NodeInterestRates.kt @@ -17,10 +17,12 @@ import net.corda.core.utilities.ProgressTracker import net.corda.irs.flows.FixingFlow import net.corda.irs.flows.RatesFixFlow import net.corda.node.services.api.AcceptsFileUpload -import net.corda.node.utilities.* +import net.corda.node.utilities.AbstractJDBCHashSet +import net.corda.node.utilities.FiberBox +import net.corda.node.utilities.JDBCHashedTable +import net.corda.node.utilities.localDate import org.jetbrains.exposed.sql.ResultRow import org.jetbrains.exposed.sql.statements.InsertStatement -import org.jetbrains.exposed.sql.transactions.transaction import java.io.InputStream import java.math.BigDecimal import java.security.KeyPair diff --git a/samples/irs-demo/src/main/kotlin/net/corda/simulation/IRSSimulation.kt b/samples/irs-demo/src/main/kotlin/net/corda/simulation/IRSSimulation.kt index 97c8f9d3ce..065f777bc4 100644 --- a/samples/irs-demo/src/main/kotlin/net/corda/simulation/IRSSimulation.kt +++ b/samples/irs-demo/src/main/kotlin/net/corda/simulation/IRSSimulation.kt @@ -11,7 +11,6 @@ import net.corda.core.contracts.UniqueIdentifier import net.corda.core.flatMap import net.corda.core.flows.FlowStateMachine import net.corda.core.map -import net.corda.core.messaging.CordaRPCOps import net.corda.core.node.services.linearHeadsOfType import net.corda.core.success import net.corda.core.transactions.SignedTransaction @@ -19,7 +18,6 @@ import net.corda.flows.TwoPartyDealFlow.Acceptor import net.corda.flows.TwoPartyDealFlow.AutoOffer import net.corda.flows.TwoPartyDealFlow.Instigator import net.corda.irs.contract.InterestRateSwap -import net.corda.node.internal.CordaRPCOpsImpl import net.corda.node.utilities.databaseTransaction import net.corda.testing.initiateSingleShotFlow import net.corda.testing.node.InMemoryMessagingNetwork diff --git a/samples/trader-demo/src/integration-test/kotlin/net/corda/traderdemo/TraderDemoTest.kt b/samples/trader-demo/src/integration-test/kotlin/net/corda/traderdemo/TraderDemoTest.kt index a5411f60d6..f28cb2ab75 100644 --- a/samples/trader-demo/src/integration-test/kotlin/net/corda/traderdemo/TraderDemoTest.kt +++ b/samples/trader-demo/src/integration-test/kotlin/net/corda/traderdemo/TraderDemoTest.kt @@ -8,7 +8,6 @@ import net.corda.node.driver.driver import net.corda.node.services.User import net.corda.node.services.startFlowPermission import net.corda.node.services.transactions.SimpleNotaryService -import net.corda.node.utilities.getHostAndPort import org.junit.Test class TraderDemoTest { @@ -20,10 +19,10 @@ class TraderDemoTest { val demoUser = listOf(User("demo", "demo", permissions)) val user = User("user1", "test", permissions = setOf(startFlowPermission())) val (nodeA, nodeB) = Futures.allAsList( - startNode("Bank A", rpcUsers = demoUser), - startNode("Bank B", rpcUsers = demoUser), - startNode("BankOfCorda", rpcUsers = listOf(user)), - startNode("Notary", setOf(ServiceInfo(SimpleNotaryService.type))) + startNode("Bank A", rpcUsers = demoUser), + startNode("Bank B", rpcUsers = demoUser), + startNode("BankOfCorda", rpcUsers = listOf(user)), + startNode("Notary", setOf(ServiceInfo(SimpleNotaryService.type))) ).getOrThrow() val (nodeARpc, nodeBRpc) = listOf(nodeA, nodeB) .map { it.rpcClientToNode().start(demoUser[0].username, demoUser[0].password).proxy() }