ExcludedEntriesConfiguration (@NotNull Project project) { final ExcludedEntriesConfiguration cfg = new ExcludedEntriesConfiguration(project.getMessageBus().syncPublisher(ExcludedEntriesListener.TOPIC)); Disposer.register(project, cfg); project.getMessageBus().connect().subscribe(ExcludedEntriesListener.TOPIC, new ExcludedEntriesListener() { @Override public void onEntryAdded(@NotNull ExcludeEntryDescription description) { clearState(); } @Override public void onEntryRemoved(@NotNull ExcludeEntryDescription description) { clearState(); } private void clearState() { if (project.isOpen()) { clearBuildManagerState(project); } } }); return cfg; }