소스 검색

Fix CME in Maps

tags/v0.10.1
Chris Smith 5 년 전
부모
커밋
7698f1465b
2개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 1
    0
      CHANGELOG
  2. 2
    1
      src/main/kotlin/com/dmdirc/ktirc/model/Maps.kt

+ 1
- 0
CHANGELOG 파일 보기

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

+ 2
- 1
src/main/kotlin/com/dmdirc/ktirc/model/Maps.kt 파일 보기

@@ -1,13 +1,14 @@
1 1
 package com.dmdirc.ktirc.model
2 2
 
3 3
 import com.dmdirc.ktirc.io.CaseMapping
4
+import java.util.*
4 5
 
5 6
 /**
6 7
  * Provides a case-insensitive mapping from a String to some value, according to the provided [CaseMapping].
7 8
  */
8 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 13
     /** Gets the value of the given key, if present. */
13 14
     operator fun get(name: String) = values.find { caseMappingProvider().areEquivalent(nameOf(it), name) }

Loading…
취소
저장