Correct ordering of parameters in CordaX500Name (#1501)

Correct ordering of parameters in CordaX500Name and change to named parameters so they can't get incorrect. A constructor with identical types is at high risk of incorrect ordering of values, and therefore it's worth ensuring this can't happen again.
This commit is contained in:
Ross Nicoll 2017-09-13 18:31:22 +01:00 committed by GitHub
parent cfd6739d23
commit eeb51527a1

View File

@ -33,7 +33,7 @@ data class CordaX500Name(val commonName: String?,
val locality: String,
val state: String?,
val country: String) {
constructor(commonName: String, organisation: String, locality: String, country: String) : this(null, commonName, organisation, locality, null, country)
constructor(commonName: String, organisation: String, locality: String, country: String) : this(commonName = commonName, organisationUnit = null, organisation = organisation, locality = locality, state = null, country = country)
/**
* @param organisation name of the organisation.
* @param locality locality of the organisation, typically nearest major city.