mirror of
https://github.com/corda/corda.git
synced 2025-06-17 14:48:16 +00:00
CORDA-1838: A few misc fixes (#4126)
* Remove unused code * Make comment readable * Remove joptsimple from node/shell * tabs vs whitespace
This commit is contained in:
@ -96,9 +96,6 @@ dependencies {
|
|||||||
// For async logging
|
// For async logging
|
||||||
compile "com.lmax:disruptor:$disruptor_version"
|
compile "com.lmax:disruptor:$disruptor_version"
|
||||||
|
|
||||||
// JOpt: for command line flags.
|
|
||||||
compile "net.sf.jopt-simple:jopt-simple:$jopt_simple_version"
|
|
||||||
|
|
||||||
// Artemis: for reliable p2p message queues.
|
// Artemis: for reliable p2p message queues.
|
||||||
// TODO: remove the forced update of commons-collections and beanutils when artemis updates them
|
// TODO: remove the forced update of commons-collections and beanutils when artemis updates them
|
||||||
compile "org.apache.commons:commons-collections4:${commons_collections_version}"
|
compile "org.apache.commons:commons-collections4:${commons_collections_version}"
|
||||||
|
@ -1,39 +0,0 @@
|
|||||||
package net.corda.node.utilities
|
|
||||||
|
|
||||||
import joptsimple.OptionException
|
|
||||||
import joptsimple.OptionParser
|
|
||||||
import joptsimple.OptionSet
|
|
||||||
import kotlin.system.exitProcess
|
|
||||||
|
|
||||||
abstract class AbstractArgsParser<out T : Any> {
|
|
||||||
protected val optionParser = OptionParser()
|
|
||||||
private val helpOption = optionParser.acceptsAll(listOf("h", "help"), "show help").forHelp()
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Parses the given [args] or exits the process if unable to, printing the help output to stderr.
|
|
||||||
* If the help option is specified then the process is also shutdown after printing the help output to stdout.
|
|
||||||
*/
|
|
||||||
fun parseOrExit(vararg args: String): T {
|
|
||||||
try {
|
|
||||||
val optionSet = optionParser.parse(*args)
|
|
||||||
if (optionSet.has(helpOption)) {
|
|
||||||
optionParser.printHelpOn(System.out)
|
|
||||||
exitProcess(0)
|
|
||||||
}
|
|
||||||
return doParse(optionSet)
|
|
||||||
} catch (e: Exception) {
|
|
||||||
when (e) {
|
|
||||||
is OptionException, is IllegalArgumentException -> {
|
|
||||||
System.err.println(e.message ?: "Unable to parse arguments.")
|
|
||||||
optionParser.printHelpOn(System.err)
|
|
||||||
exitProcess(1)
|
|
||||||
}
|
|
||||||
else -> throw e
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fun parse(vararg args: String): T = doParse(optionParser.parse(*args))
|
|
||||||
|
|
||||||
protected abstract fun doParse(optionSet: OptionSet): T
|
|
||||||
}
|
|
@ -71,6 +71,10 @@ dependencies {
|
|||||||
compile project(":client:jackson")
|
compile project(":client:jackson")
|
||||||
compile project(":test-utils")
|
compile project(":test-utils")
|
||||||
compile project(path: ":samples:irs-demo:cordapp", configuration: "demoArtifacts")
|
compile project(path: ":samples:irs-demo:cordapp", configuration: "demoArtifacts")
|
||||||
|
|
||||||
|
// JOpt: for command line flags.
|
||||||
|
compile "net.sf.jopt-simple:jopt-simple:$jopt_simple_version"
|
||||||
|
|
||||||
testCompile('org.springframework.boot:spring-boot-starter-test') {
|
testCompile('org.springframework.boot:spring-boot-starter-test') {
|
||||||
exclude module: "spring-boot-starter-logging"
|
exclude module: "spring-boot-starter-logging"
|
||||||
exclude module: "logback-classic"
|
exclude module: "logback-classic"
|
||||||
|
@ -48,6 +48,9 @@ dependencies {
|
|||||||
compile 'org.controlsfx:controlsfx:8.40.12'
|
compile 'org.controlsfx:controlsfx:8.40.12'
|
||||||
// This provide com.apple.eawt stub for non-mac system.
|
// This provide com.apple.eawt stub for non-mac system.
|
||||||
compile 'com.yuvimasory:orange-extensions:1.3.0'
|
compile 'com.yuvimasory:orange-extensions:1.3.0'
|
||||||
|
|
||||||
|
// JOpt: for command line flags.
|
||||||
|
compile "net.sf.jopt-simple:jopt-simple:$jopt_simple_version"
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.withType(JavaCompile) {
|
tasks.withType(JavaCompile) {
|
||||||
|
@ -124,10 +124,10 @@ class Main : App(MainView::class) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This main method will starts 5 nodes (Notary, USA Bank, UK Bank, Bob and Alice) locally for UI testing,
|
* This main method will start 5 nodes (Notary, USA Bank, UK Bank, Bob and Alice) locally for UI testing,
|
||||||
* they will be on localhost ports 20005, 20008, 20011, 20014 and 20017 respectively.
|
* which will bind to ports 20005, 20008, 20011, 20014 and 20017 locally.
|
||||||
*
|
*
|
||||||
* The simulation start with pre-allocating chunks of cash to each of the party in 2 currencies (USD, GBP), then it enter a loop to generate random events.
|
* The simulation starts by pre-allocating chunks of cash to each of the parties in 2 currencies (USD, GBP), then it enters a loop which generates random events.
|
||||||
* On each iteration, the issuers will execute a Cash Issue or Cash Exit flow (at a 9:1 ratio) and a random party will execute a move of cash to another random party.
|
* On each iteration, the issuers will execute a Cash Issue or Cash Exit flow (at a 9:1 ratio) and a random party will execute a move of cash to another random party.
|
||||||
*/
|
*/
|
||||||
fun main(args: Array<String>) {
|
fun main(args: Array<String>) {
|
||||||
|
@ -39,10 +39,6 @@ dependencies {
|
|||||||
// Jackson support: serialisation to/from JSON, YAML, etc.
|
// Jackson support: serialisation to/from JSON, YAML, etc.
|
||||||
compile project(':client:jackson')
|
compile project(':client:jackson')
|
||||||
|
|
||||||
|
|
||||||
// JOpt: for command line flags.
|
|
||||||
compile "net.sf.jopt-simple:jopt-simple:$jopt_simple_version"
|
|
||||||
|
|
||||||
// CRaSH: An embeddable monitoring and admin shell with support for adding new commands written in Groovy.
|
// CRaSH: An embeddable monitoring and admin shell with support for adding new commands written in Groovy.
|
||||||
compile("com.github.corda.crash:crash.shell:$crash_version") {
|
compile("com.github.corda.crash:crash.shell:$crash_version") {
|
||||||
exclude group: "org.slf4j", module: "slf4j-jdk14"
|
exclude group: "org.slf4j", module: "slf4j-jdk14"
|
||||||
|
Reference in New Issue
Block a user