Use LinkedHashSet instead of HashSet as HashSet is BLACKLISTED!! (#1146)

This commit is contained in:
Roger Willis 2017-08-01 09:56:54 +01:00 committed by GitHub
parent f2df05a15b
commit f6e05aeae9

View File

@ -18,6 +18,7 @@ import java.security.cert.*
import java.util.*
import java.util.concurrent.ConcurrentHashMap
import javax.annotation.concurrent.ThreadSafe
import kotlin.collections.LinkedHashSet
/**
* Simple identity service which caches parties and provides functionality for efficient lookup.
@ -96,7 +97,7 @@ class InMemoryIdentityService(identities: Iterable<PartyAndCertificate> = emptyS
}
override fun partiesFromName(query: String, exactMatch: Boolean): Set<Party> {
val results = HashSet<Party>()
val results = LinkedHashSet<Party>()
for ((x500name, partyAndCertificate) in principalToParties) {
val party = partyAndCertificate.party
for (rdn in x500name.rdNs) {