@@ -186,44 +186,40 @@ class LiveInstrumentEventListener(
186186 activeInstruments.remove(event.instrument)
187187 InstrumentEventWindowService .getInstance(project).addInstrumentEvent(event)
188188
189- val inlayMark = SourceMarker .getInstance(project).findByInstrumentId(event.instrument.id!! )
190- if (inlayMark != null ) {
191- if (inlayMark is GutterMark ) {
189+ SourceMarker .getInstance(project).findByInstrumentId(event.instrument.id!! ).forEach {
190+ if (it is GutterMark ) {
192191 if (event.instrument.meta[" created_by" ] != UserData .selfInfo(project)?.developer?.id) {
193192 // just remove foreign instrument icons
194- inlayMark .dispose()
193+ it .dispose()
195194 } else if (event.instrument !is LiveBreakpoint ) {
196195 // just remove non-breakpoint icons
197- inlayMark .dispose()
196+ it .dispose()
198197 } else {
199198 if (event.cause == null ) {
200- inlayMark .configuration.icon = PluginIcons .Breakpoint .complete
199+ it .configuration.icon = PluginIcons .Breakpoint .complete
201200 } else {
202- inlayMark .configuration.icon = PluginIcons .Breakpoint .error
201+ it .configuration.icon = PluginIcons .Breakpoint .error
203202 }
204- inlayMark .sourceFileMarker.refresh()
203+ it .sourceFileMarker.refresh()
205204 }
206205 }
207206
208- val eventListeners = inlayMark.getUserData(SourceMarkerKeys .INSTRUMENT_EVENT_LISTENERS )
209- if (eventListeners?.isNotEmpty() == true ) {
210- eventListeners.forEach { it.onInstrumentRemovedEvent(event) }
211- }
207+ it.getUserData(SourceMarkerKeys .INSTRUMENT_EVENT_LISTENERS )
208+ ?.forEach { it.onInstrumentRemovedEvent(event) }
212209 }
213210 }
214211 }
215212
216- override fun onInstrumentHitEvent (event : LiveInstrumentHit ) {
217- ApplicationManager .getApplication().invokeLater {
218- InstrumentEventWindowService .getInstance(project).addInstrumentEvent(event)
213+ override fun onInstrumentHitEvent (event : LiveInstrumentHit ) = ApplicationManager .getApplication().invokeLater {
214+ InstrumentEventWindowService .getInstance(project).addInstrumentEvent(event)
219215
220- if (event is LiveBreakpointHit ) {
221- SourceMarker .getInstance(project).findByInstrumentId(event.instrument.id!! )
222- ? .getUserData(SourceMarkerKeys .INSTRUMENT_EVENT_LISTENERS )
223- ?.forEach { it.onBreakpointHitEvent(event) }
224- } else if (event is LiveLogHit ) {
225- SourceMarker .getInstance(project).findByInstrumentId(event.instrument.id!! )
226- ? .getUserData(SourceMarkerKeys .INSTRUMENT_EVENT_LISTENERS )?.forEach { it.onLogHitEvent(event) }
216+ if (event is LiveBreakpointHit ) {
217+ SourceMarker .getInstance(project).findByInstrumentId(event.instrument.id!! ).forEach {
218+ it .getUserData(SourceMarkerKeys .INSTRUMENT_EVENT_LISTENERS )?.forEach { it.onBreakpointHitEvent(event) }
219+ }
220+ } else if (event is LiveLogHit ) {
221+ SourceMarker .getInstance(project).findByInstrumentId(event.instrument.id!! ).forEach {
222+ it .getUserData(SourceMarkerKeys .INSTRUMENT_EVENT_LISTENERS )?.forEach { it.onLogHitEvent(event) }
227223 }
228224 }
229225 }
0 commit comments