Skip to content

Commit bb4cca1

Browse files
committed
* Fix breakpoints update bugs.
1 parent d76e282 commit bb4cca1

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

adapter/src/main/kotlin/org/javacs/ktda/core/Source.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,8 @@ import java.nio.file.Path
66
class Source(
77
val name: String,
88
val filePath: Path
9-
)
9+
) {
10+
override fun equals(other: Any?): Boolean {
11+
return (other is Source) && (name == other.name) && (filePath == other.filePath)
12+
}
13+
}

adapter/src/main/kotlin/org/javacs/ktda/util/ObservableMap.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,12 @@ class ObservableMap<K, V>(
1313
fun remove(key: K) = entries.remove(key).also { fire() }
1414

1515
operator fun set(key: K, value: V) {
16-
entries[key] = value
16+
try {
17+
val sameKey = entries.keys.first { it == key }
18+
entries[sameKey] = value
19+
} catch(error: NoSuchElementException) {
20+
entries[key] = value
21+
}
1722
fire()
1823
}
1924

0 commit comments

Comments
 (0)