void (@NotNull Object buildId, @NotNull BuildEvent event) { if (event instanceof StartBuildEvent) { ApplicationManager.getApplication().invokeAndWait(() -> { onStartBuild(buildId, (StartBuildEvent)event); for (BuildEvent buildEvent : myAfterStartEvents) { processEvent(buildId, buildEvent); } myAfterStartEvents.clear(); isBuildStartEventProcessed.set(true); }); return; } if (!isBuildStartEventProcessed.get()) { myAfterStartEvents.add(event); } else { processEvent(buildId, event); } }