mirror of
https://github.com/corda/corda.git
synced 2025-04-09 04:15:35 +00:00
[CORDA-1542]: Exception error codes aren't stable (fixed). (#3887)
This commit is contained in:
parent
91dfa277e3
commit
793a52c57a
@ -147,8 +147,8 @@ open class NodeStartup(val args: Array<String>) {
|
||||
|
||||
val cause = this.cause
|
||||
return when {
|
||||
cause != null && !visited.contains(cause) -> Objects.hash(this::class.java.name, stackTrace, cause.staticLocationBasedHash(visited + cause))
|
||||
else -> Objects.hash(this::class.java.name, stackTrace)
|
||||
cause != null && !visited.contains(cause) -> Objects.hash(this::class.java.name, stackTrace.customHashCode(), cause.staticLocationBasedHash(visited + cause))
|
||||
else -> Objects.hash(this::class.java.name, stackTrace.customHashCode())
|
||||
}
|
||||
}
|
||||
|
||||
@ -177,6 +177,19 @@ open class NodeStartup(val args: Array<String>) {
|
||||
}
|
||||
}
|
||||
|
||||
private fun Array<StackTraceElement?>?.customHashCode(): Int {
|
||||
|
||||
if (this == null) {
|
||||
return 0
|
||||
}
|
||||
return Arrays.hashCode(map { it?.customHashCode() ?: 0 }.toIntArray())
|
||||
}
|
||||
|
||||
private fun StackTraceElement.customHashCode(): Int {
|
||||
|
||||
return Objects.hash(StackTraceElement::class.java.name, methodName, lineNumber)
|
||||
}
|
||||
|
||||
private fun configFileNotFoundMessage(configFile: Path): String {
|
||||
return """
|
||||
Unable to load the node config file from '$configFile'.
|
||||
@ -581,3 +594,5 @@ open class NodeStartup(val args: Array<String>) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user