void () { VcsConfiguration config = VcsConfiguration.getInstance(myProject); List<LocalChangeList> listsToBeDeletedSilently; List<LocalChangeList> listsToBeDeleted; Function<String, LocalChangeList> toDeleteMapping = id -> { LocalChangeList list = getChangeList(id); if (list == null || list.isDefault() || list.isReadOnly() || !list.getChanges().isEmpty()) return null; return list; }; synchronized (myDataLock) { if (LOG.isDebugEnabled()) { LOG.debug(String.format("Empty changelist deletion, scheduled:\nsilently: %s\nasking: %s", myListsToBeDeletedSilently, myListsToBeDeleted)); } myListsToBeDeleted.removeAll(myListsToBeDeletedSilently); listsToBeDeletedSilently = mapNotNull(myListsToBeDeletedSilently, toDeleteMapping); myListsToBeDeletedSilently.clear(); boolean askLater = myModalNotificationsBlocked && config.REMOVE_EMPTY_INACTIVE_CHANGELISTS == Value.SHOW_CONFIRMATION; if (!askLater) { listsToBeDeleted = mapNotNull(myListsToBeDeleted, toDeleteMapping); myListsToBeDeleted.clear(); } else { listsToBeDeleted = Collections.emptyList(); } myEmptyListDeletionScheduled = false; if (LOG.isDebugEnabled()) { LOG.debug(String.format("Empty changelist deletion, to be deleted:\nsilently: %s\nasking: %s", listsToBeDeletedSilently, listsToBeDeleted)); } } if (config.REMOVE_EMPTY_INACTIVE_CHANGELISTS == Value.DO_NOTHING_SILENTLY || config.REMOVE_EMPTY_INACTIVE_CHANGELISTS == Value.SHOW_CONFIRMATION && ApplicationManager.getApplication().isUnitTestMode()) { listsToBeDeleted = Collections.emptyList(); } ChangeListRemoveConfirmation.deleteEmptyInactiveLists(myProject, listsToBeDeletedSilently, toAsk -> true); ChangeListRemoveConfirmation.deleteEmptyInactiveLists(myProject, listsToBeDeleted, toAsk -> config.REMOVE_EMPTY_INACTIVE_CHANGELISTS == Value.DO_ACTION_SILENTLY || showRemoveEmptyChangeListsProposal(myProject, config, toAsk)); }