Browse Source

Fix CME in Maps

tags/v0.10.1
Chris Smith 5 years ago
parent
commit
7698f1465b
2 changed files with 3 additions and 1 deletions
  1. 1
    0
      CHANGELOG
  2. 2
    1
      src/main/kotlin/com/dmdirc/ktirc/model/Maps.kt

+ 1
- 0
CHANGELOG View File

2
 
2
 
3
  * Added NickChangeFailed event for when nicknames are in use, banned, etc
3
  * Added NickChangeFailed event for when nicknames are in use, banned, etc
4
  * Added sendPart method
4
  * Added sendPart method
5
+ * Fix occasional ConcurrentModificationException when adding state
5
  * (Internal) Moved message processors into their own package
6
  * (Internal) Moved message processors into their own package
6
 
7
 
7
 v0.10.0
8
 v0.10.0

+ 2
- 1
src/main/kotlin/com/dmdirc/ktirc/model/Maps.kt View File

1
 package com.dmdirc.ktirc.model
1
 package com.dmdirc.ktirc.model
2
 
2
 
3
 import com.dmdirc.ktirc.io.CaseMapping
3
 import com.dmdirc.ktirc.io.CaseMapping
4
+import java.util.*
4
 
5
 
5
 /**
6
 /**
6
  * Provides a case-insensitive mapping from a String to some value, according to the provided [CaseMapping].
7
  * Provides a case-insensitive mapping from a String to some value, according to the provided [CaseMapping].
7
  */
8
  */
8
 abstract class CaseInsensitiveMap<T>(private val caseMappingProvider: () -> CaseMapping, private val nameOf: (T) -> String) : Iterable<T> {
9
 abstract class CaseInsensitiveMap<T>(private val caseMappingProvider: () -> CaseMapping, private val nameOf: (T) -> String) : Iterable<T> {
9
 
10
 
10
-    private val values = HashSet<T>()
11
+    private val values = Collections.synchronizedSet(HashSet<T>())
11
 
12
 
12
     /** Gets the value of the given key, if present. */
13
     /** Gets the value of the given key, if present. */
13
     operator fun get(name: String) = values.find { caseMappingProvider().areEquivalent(nameOf(it), name) }
14
     operator fun get(name: String) = values.find { caseMappingProvider().areEquivalent(nameOf(it), name) }

Loading…
Cancel
Save