Skip to content

Commit 327b11d

Browse files
committed
Remove unused VMEventBus.listen method
1 parent 2fee451 commit 327b11d

File tree

1 file changed

+0
-15
lines changed

1 file changed

+0
-15
lines changed

adapter/src/main/kotlin/org/javacs/ktda/jdi/event/VMEventBus.kt

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -132,21 +132,6 @@ class VMEventBus(private val vm: VirtualMachine): DebuggeeEventBus {
132132
}
133133
}
134134
}
135-
136-
/** Subscribes to a JDI event type and lets the listener decide whether to stop subscribing. */
137-
fun <E: JDIEvent> listen(eventClass: KClass<E>, listener: (VMEvent<E>) -> Boolean) {
138-
var box = Box<((VMEvent<E>) -> Unit)?>(null)
139-
box.value = {
140-
val continueSubscribing = listener(it)
141-
142-
if (!continueSubscribing) {
143-
// See method above for rationale
144-
@Suppress("UNCHECKED_CAST")
145-
eventListeners[eventClass]?.remove(box.value as (VMEvent<JDIEvent>) -> Unit)
146-
}
147-
}
148-
subscribe(eventClass, box.value!!)
149-
}
150135

151136
private fun dispatchEvent(event: JDIEvent, eventSet: JDIEventSet): Boolean {
152137
val VMEvent = VMEvent(event, eventSet)

0 commit comments

Comments
 (0)