Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
260,200
ListData (@NotNull String name, @Nullable String description, @Nullable String id, @Nullable ChangeListData data) { if (!assertChangeListsEnabled()) return myDefault; ListData existingList = getDataByName(name); if (existingList != null) { LOG.error("Attempt to create duplicate changelist " + name); return existingList...
addChangeListEntry
260,201
List<Change> (@NotNull String name) { if (!assertChangeListsEnabled()) return null; ListData removedList = getDataByName(name); if (removedList == null) return null; if (removedList.isDefault) { LOG.error("Cannot remove default changelist"); return null; } List<Change> movedChanges = new ArrayList<>(); myChangeMappings...
removeChangeList
260,202
void (@NotNull FilePath path, @NotNull List<String> beforeChangeListsIds, @NotNull List<String> afterChangeListsIds) { myReadOnlyChangesCacheInvalidated.set(true); Set<String> removed = new HashSet<>(beforeChangeListsIds); afterChangeListsIds.forEach(removed::remove); Set<String> added = new HashSet<>(afterChangeListsI...
notifyChangelistsChanged
260,203
void (@NotNull ChangeListWorker updatedWorker, @NotNull ChangeListDeltaListener deltaListener) { assert myMainWorker; assert myChangeListsEnabled == updatedWorker.myChangeListsEnabled; HashMap<Change, ListData> oldChangeMappings = new HashMap<>(myChangeMappings); notifyPathsChanged(myIdx, updatedWorker.myIdx, deltaList...
applyChangesFromUpdate
260,204
void (boolean enabled) { if (myChangeListsEnabled == enabled) return; LOG.debug("[setChangeListsEnabled] - " + enabled); if (enabled) { myChangeListsEnabled = true; enableChangeLists(); } else { disableChangeLists(); myChangeListsEnabled = false; } myDelayedNotificator.allChangeListsMappingsChanged(); myDelayedNotifica...
setChangeListsEnabled
260,205
void () { ListData fallbackList = getDataByName(LocalChangeList.getDefaultName()); if (fallbackList == null) { fallbackList = putNewListData(new ListData(null, LocalChangeList.getDefaultName())); } LocalChangeList oldDefaultList = getDefaultList(); String oldComment = editComment(fallbackList.name, ""); boolean readOnl...
disableChangeLists
260,206
void () { LOG.assertTrue(myLists.size() == 1); boolean readOnlyChanged = setReadOnly(myDefault.name, false); LocalChangeListImpl newList = toChangeList(myDefault); if (readOnlyChanged) myDelayedNotificator.changeListChanged(newList); }
enableChangeLists
260,207
boolean () { return myChangeListsEnabled; }
areChangeListsEnabled
260,208
boolean () { if (myChangeListsEnabled) return true; LOG.error("Changelists are disabled, modification ignored", new Throwable()); return false; }
assertChangeListsEnabled
260,209
void (@NotNull ChangeListsIndexes was, @NotNull ChangeListsIndexes became, @NotNull ChangeListDeltaListener deltaListener) { final Set<BaseRevision> toRemove = new HashSet<>(); final Set<BaseRevision> toAdd = new HashSet<>(); final Set<BeforeAfter<BaseRevision>> toModify = new HashSet<>(); was.getDelta(became, toRemove...
notifyPathsChanged
260,210
void (@NotNull String oldDefaultId, @NotNull String newDefaultId) { for (PartialChangeTracker tracker : myPartialChangeTrackers.values()) { tracker.defaultListChanged(oldDefaultId, newDefaultId); } }
fireDefaultListChanged
260,211
void (@NotNull String listId) { for (PartialChangeTracker tracker : myPartialChangeTrackers.values()) { tracker.changeListRemoved(listId); } }
fireChangeListRemoved
260,212
ListData (@NotNull Change change) { ListData oldList = myChangeMappings.remove(change); myReadOnlyChangesCache = null; return oldList; }
removeChangeMapping
260,213
void (@NotNull Change change, @NotNull ListData list) { myChangeMappings.put(change, list); myReadOnlyChangesCache = null; }
putChangeMapping
260,214
ListData (@NotNull ListData list) { ListData listWithSameName = getDataByName(list.name); if (listWithSameName != null) { LOG.error(String.format("Attempt to create changelist with same name: %s - %s", list.name, list.id)); return listWithSameName; } ListData listWithSameId = getDataById(list.id); if (listWithSameId !=...
putNewListData
260,215
ListData (@Nullable ListData listData) { if (listData == null) LOG.error("ListData not found"); return ObjectUtils.notNull(listData, myDefault); }
notNullList
260,216
ListData (@NotNull String id) { return ContainerUtil.find(myLists, list -> list.id.equals(id)); }
getDataById
260,217
ListData (@NotNull String name) { return ContainerUtil.find(myLists, list -> list.name.equals(name)); }
getDataByName
260,218
ListData (@NotNull String id) { ListData list = getDataById(id); if (myMainWorker && list == null) LOG.error(String.format("Unknown changelist %s", id)); return list; }
getDataByIdVerify
260,219
PartialChangeTracker (@NotNull Change change) { if (!myChangeListsEnabled) return null; if (myPartialChangeTrackers.isEmpty()) return null; if (!myIdx.getChanges().contains(change)) return null; ContentRevision revision = change.getAfterRevision(); if (revision == null) return null; return myPartialChangeTrackers.get(r...
getChangeTrackerFor
260,220
HashSet<ListData> (@NotNull PartialChangeTracker tracker) { HashSet<ListData> data = new HashSet<>(); for (String listId : tracker.getAffectedChangeListsIds()) { ListData partialList = getDataById(listId); if (myMainWorker && partialList == null) { LOG.warn(String.format("Unknown changelist %s for file %s", listId, tra...
getAffectedLists
260,221
LocalChangeListImpl (@Nullable ListData data) { if (data == null) return null; if (myReadOnlyChangesCache == null || myReadOnlyChangesCacheInvalidated.get()) { myReadOnlyChangesCacheInvalidated.set(false); myReadOnlyChangesCache = getChangesMapping(); } Set<Change> cachedChanges = myReadOnlyChangesCache.get(data); Set<...
toChangeList
260,222
LocalChangeListImpl (@Nullable ListData data) { if (data == null) return null; return buildChangeListFrom(data) .build(); }
toLightChangeList
260,223
Change (@NotNull Change change, @NotNull ListData list) { if (change.getClass() == Change.class) { return new ChangeListChange(change, list.name, list.id); } return change; }
toChangeListChange
260,224
String () { String lists = StringUtil.join(myLists, list -> String.format("list: %s (%s) changes: %s", list.name, list.id, StringUtil.join(getChangesIn(list), ", ")), "\n"); //NON-NLS String trackers = StringUtil.join(myPartialChangeTrackers.entrySet(), (entry) -> entry.getKey() + " " + entry.getValue().getAffectedChan...
toString
260,225
Project () { return myWorker.getProject(); }
getProject
260,226
void (@Nullable VcsModifiableDirtyScope scope) { myWorker.myChangeMappings.forEach((change, list) -> { putPathBeforeUpdate(ChangesUtil.getBeforePath(change), list.id); putPathBeforeUpdate(ChangesUtil.getAfterPath(change), list.id); myChangesBeforeUpdateMap.get(list.id).add(change); }); List<Change> removedChanges = rem...
notifyStartProcessingChanges
260,227
void (@Nullable FilePath path, @NotNull String listId) { if (path == null) return; String oldListId = myListsForPathsBeforeUpdate.get(path); if (CONFLICT_CHANGELIST_ID.equals(oldListId) || listId.equals(oldListId)) return; if (oldListId == null) { myListsForPathsBeforeUpdate.put(path, listId); } else { myListsForPathsB...
putPathBeforeUpdate
260,228
String (@NotNull Change change) { FilePath bPath = ChangesUtil.getBeforePath(change); FilePath aPath = ChangesUtil.getAfterPath(change); String bListId = myListsForPathsBeforeUpdate.get(bPath); String aListId = myListsForPathsBeforeUpdate.get(aPath); if (CONFLICT_CHANGELIST_ID.equals(bListId) || CONFLICT_CHANGELIST_ID....
guessChangeListByPaths
260,229
List<Change> (@Nullable VcsDirtyScope scope) { if (LOG.isDebugEnabled()) { LOG.debug(String.format("Process scope: %s", scope)); } List<Change> removed = new ArrayList<>(); for (Change change : myWorker.myIdx.getChanges()) { ContentRevision before = change.getBeforeRevision(); ContentRevision after = change.getAfterRev...
removeChangesUnderScope
260,230
boolean (@Nullable ContentRevision before, @Nullable ContentRevision after, @NotNull Project project) { return isIgnoredRevision(before, project) && isIgnoredRevision(after, project); }
isIgnoredChange
260,231
boolean (@Nullable ContentRevision revision, final @NotNull Project project) { if (revision == null) return true; return ReadAction.compute(() -> { if (project.isDisposed()) return false; return ProjectLevelVcsManager.getInstance(project).isIgnored(revision.getFile()); }); }
isIgnoredRevision
260,232
void (@NotNull DelayedNotificator dispatcher, @Nullable VcsDirtyScope scope) { List<ChangeList> changedLists = new ArrayList<>(); final Map<LocalChangeListImpl, List<Change>> removedChanges = new HashMap<>(); final Map<LocalChangeListImpl, List<Change>> addedChanges = new HashMap<>(); for (ChangeListWorker.ListData lis...
notifyDoneProcessingChanges
260,233
void (@NotNull ChangeListWorker.ListData list, @NotNull List<? super Change> removedChanges, @NotNull List<? super Change> addedChanges) { ObjectOpenHashSet<Change> changesBeforeUpdate = myChangesBeforeUpdateMap.get(list.id); Set<Change> listChanges = new HashSet<>(myWorker.getChangesIn(list)); for (Change newChange : ...
doneProcessingChanges
260,234
Change (@NotNull ObjectOpenHashSet<Change> changesBeforeUpdate, @NotNull Change newChange) { Change oldChange = changesBeforeUpdate.get(newChange); if (oldChange != null && sameBeforeRevision(oldChange, newChange) && newChange.getFileStatus().equals(oldChange.getFileStatus())) { return oldChange; } return null; }
findOldChange
260,235
boolean (@NotNull Change change1, @NotNull Change change2) { final ContentRevision b1 = change1.getBeforeRevision(); final ContentRevision b2 = change2.getBeforeRevision(); if (b1 != null && b2 != null) { final VcsRevisionNumber rn1 = b1.getRevisionNumber(); final VcsRevisionNumber rn2 = b2.getRevisionNumber(); return ...
sameBeforeRevision
260,236
void () { checkForMultipleCopiesNotMove(); }
finish
260,237
ChangeListWorker () { return myWorker; }
getUpdatedWorker
260,238
void () { final MultiMap<FilePath, Change> moves = new MultiMap<>(); for (Change change : myWorker.myIdx.getChanges()) { if (change.isMoved() || change.isRenamed()) { moves.putValue(change.getBeforeRevision().getFile(), change); } } for (FilePath filePath : moves.keySet()) { final List<Change> copies = (List<Change>)mo...
checkForMultipleCopiesNotMove
260,239
void (@NotNull String name, @NotNull Change change, AbstractVcs vcs) { if (LOG.isDebugEnabled()) { LOG.debug(String.format("[addChangeToList] name: %s change: %s vcs: %s", name, ChangesUtil.getFilePath(change).getPath(), vcs == null ? null : vcs.getName())); } ListData list = myWorker.getDataByName(name); if (list != n...
addChangeToList
260,240
void (@NotNull Change change, AbstractVcs vcs) { ListData listData = guessListForChange(change); addChangeToList(listData, change, vcs); }
addChangeToCorrespondingList
260,241
ListData (@NotNull Change change) { if (LOG.isDebugEnabled()) { final String path = ChangesUtil.getFilePath(change).getPath(); LOG.debug("[addChangeToCorrespondingList] for change " + path + " type: " + change.getType() + " have before revision: " + (change.getBeforeRevision() != null)); } for (ChangeListWorker.ListDat...
guessListForChange
260,242
void (@Nullable ListData list, @NotNull Change change, AbstractVcs vcs) { if (myWorker.myIdx.getChanges().contains(change)) { LOG.warn(String.format("Multiple equal changes added: %s", change)); return; } myWorker.myIdx.changeAdded(change, vcs); if (list != null) { myWorker.putChangeMapping(change, list); } myWorker.my...
addChangeToList
260,243
void (@Nullable FilePath filePath) { Change change = myWorker.getChangeForPath(filePath); if (change == null) return; myWorker.myIdx.changeRemoved(change); myWorker.removeChangeMapping(change); }
removeRegisteredChangeFor
260,244
List<LocalChangeList> () { return myWorker.getChangeLists(); }
getListsCopy
260,245
LocalChangeList (@Nullable String name) { if (name == null) return null; ListData data = myWorker.getDataByName(name); if (data == null) return null; // Skip changes for performance reasons. // We're in the middle of filling lists with changes from VCS, // while each 'addChangeToList' call clears 'myReadOnlyChangesCach...
findChangeList
260,246
LocalChangeList (@NotNull String name, @Nullable String comment) { ListData data = myWorker.addChangeListEntry(name, comment, null, null); return myWorker.toLightChangeList(data); }
addChangeList
260,247
LocalChangeList (@NotNull String name, @Nullable String comment) { LocalChangeList list = findChangeList(name); if (list != null) return list; return addChangeList(name, comment); }
findOrCreateList
260,248
void (@NotNull String name, @Nullable String comment) { myWorker.editComment(name, StringUtil.notNullize(comment)); }
editComment
260,249
void (@NotNull String oldName, @NotNull String newName) { myWorker.editName(oldName, newName); }
editName
260,250
void (@NotNull Collection<String> names) { myListsToDisappear.addAll(names); }
setListsToDisappear
260,251
FileStatus (@NotNull VirtualFile file) { return myWorker.getStatus(file); }
getStatus
260,252
FileStatus (@NotNull FilePath filePath) { return myWorker.getStatus(filePath); }
getStatus
260,253
void (@NotNull String list) { myWorker.setDefaultList(list); }
setDefaultChangeList
260,254
List<String> () { return new ArrayList<>(myChangeListsIds); }
getAffectedChangeListsIds
260,255
void (@NotNull String defaultId, @NotNull List<String> changelistsId, @Nullable String fileChangelistIds) { throw new UnsupportedOperationException(); }
initChangeTracking
260,256
void (@NotNull String oldListId, @NotNull String newListId) { myDefaultId = newListId; }
defaultListChanged
260,257
void (@NotNull String listId) { myChangeListsIds.remove(listId); if (myChangeListsIds.isEmpty()) myChangeListsIds.add(myDefaultId); }
changeListRemoved
260,258
void (@NotNull String fromListId, @NotNull String toListId) { if (myChangeListsIds.remove(fromListId)) { myChangeListsIds.add(toListId); } }
moveChanges
260,259
void (@NotNull String toListId) { myChangeListsIds.clear(); myChangeListsIds.add(toListId); }
moveChangesTo
260,260
boolean (@NotNull Project project, @NotNull Collection<? extends VirtualFile> rootsToSave, @NotNull String operationTitle, @NotNull ProgressIndicator indicator, @NotNull Runnable operation) { new DefaultPreservingExecutorImpl(project, rootsToSave, operationTitle, indicator, operation).execute(); return true; }
execute
260,261
void () { myMap.clear(); }
cleanAll
260,262
void (@NotNull FilePath file) { if (!containsFile(file)) { myMap.add(file); } }
addFile
260,263
RecursiveFilePathHolderImpl () { final RecursiveFilePathHolderImpl copyHolder = new RecursiveFilePathHolderImpl(myProject); copyHolder.myMap.addAll(myMap); return copyHolder; }
copy
260,264
boolean (@NotNull FilePath file, @NotNull VirtualFile vcsRoot) { return containsFile(file); }
containsFile
260,265
boolean (@NotNull FilePath file) { if (myMap.isEmpty()) return false; FilePath parent = file; while (parent != null) { if (myMap.contains(parent)) return true; parent = parent.getParentPath(); } return false; }
containsFile
260,266
Collection<FilePath> () { return myMap; }
values
260,267
void (@NotNull VcsDirtyScope scope) { if (myProject.isDisposed()) return; final Iterator<FilePath> iterator = myMap.iterator(); while (iterator.hasNext()) { final FilePath file = iterator.next(); if (isFileDirty(scope, file)) { iterator.remove(); } } }
cleanUnderScope
260,268
boolean (@NotNull VcsDirtyScope scope, @NotNull FilePath filePath) { return scope.belongsTo(filePath); }
isFileDirty
260,269
boolean (final Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; final RecursiveFilePathHolderImpl that = (RecursiveFilePathHolderImpl)o; return myMap.equals(that.myMap); }
equals
260,270
int () { return myMap.hashCode(); }
hashCode
260,271
ChangesViewToolWindowPanel () { if (myToolWindowPanel == null) { Activity activity = StartUpMeasurer.startActivity("ChangesViewToolWindowPanel initialization"); // ChangesViewPanel is used for a singular ChangesViewToolWindowPanel instance. Cleanup is not needed. ChangesViewPanel changesViewPanel = initChangesPanel(); ...
initToolWindowPanel
260,272
Collection<String> () { return myState.groupingKeys; }
getGrouping
260,273
String () { return getLocalChangesToolWindowName(myProject); }
get
260,274
ChangesViewI (@NotNull Project project) { return project.getService(ChangesViewI.class); }
getInstance
260,275
ChangesViewEx (@NotNull Project project) { return (ChangesViewEx)getInstance(project); }
getInstanceEx
260,276
Factory<JComponent> (@NlsContexts.Label String text, final boolean isError) { return () -> { JLabel label = new JBLabel(StringUtil.replace(text.trim(), "\n", UIUtil.BR)).setCopyable(true); label.setVerticalTextPosition(SwingConstants.TOP); label.setBorder(JBUI.Borders.empty(3)); label.setForeground(isError ? JBColor.RE...
createTextStatusFactory
260,277
void () { }
dispose
260,278
void (@NotNull Content content) { content.putUserData(Content.TAB_DND_TARGET_KEY, new MyContentDnDTarget(myProject, content)); }
preloadTabContent
260,279
void (@NotNull ChangesViewManager.State state) { myState = state; migrateShowFlattenSetting(); }
loadState
260,280
void () { if (!myState.myShowFlatten) { myState.groupingKeys.clear(); myState.groupingKeys.addAll(DEFAULT_GROUPING_KEYS); myState.myShowFlatten = true; } }
migrateShowFlattenSetting
260,281
boolean (Project project) { return ProjectLevelVcsManager.getInstance(project).hasActiveVcss() && !CommitModeManager.getInstance(project).getCurrentCommitMode().hideLocalChangesTab(); }
test
260,282
void (@NotNull Collection<String> grouping) { myState.groupingKeys.clear(); myState.groupingKeys.addAll(grouping); }
setGrouping
260,283
void () { if (myToolWindowPanel == null) return; myToolWindowPanel.scheduleRefresh(); }
scheduleRefresh
260,284
void (VirtualFile vFile) { if (myToolWindowPanel == null) return; myToolWindowPanel.selectFile(vFile); }
selectFile
260,285
void (@NotNull List<? extends Change> changes) { if (myToolWindowPanel == null) return; myToolWindowPanel.selectChanges(changes); }
selectChanges
260,286
void (@NlsContexts.Label String text, boolean isError) { if (myToolWindowPanel == null) return; myToolWindowPanel.updateProgressText(text, isError); }
updateProgressText
260,287
void (boolean b) { if (myToolWindowPanel == null) return; myToolWindowPanel.setBusy(b); }
setBusy
260,288
void (@NotNull String groupingKey) { if (myToolWindowPanel == null) return; myToolWindowPanel.setGrouping(groupingKey); }
setGrouping
260,289
void () { if (myToolWindowPanel == null) return; myToolWindowPanel.updateCommitWorkflow(); }
updateCommitWorkflow
260,290
void () { if (myToolWindowPanel == null) return; myToolWindowPanel.scheduleRefreshNow(); }
refreshImmediately
260,291
boolean () { if (myToolWindowPanel == null) return false; return myToolWindowPanel.isAllowExcludeFromCommit(); }
isAllowExcludeFromCommit
260,292
boolean (@NotNull Project project) { return EditorTabDiffPreviewManager.getInstance(project).isEditorDiffPreviewAvailable(); }
isEditorPreview
260,293
void (boolean onlyIfEmpty) { if (myToolWindowPanel == null) return; myToolWindowPanel.closeEditorPreview(onlyIfEmpty); }
closeEditorPreview
260,294
void () { if (myToolWindowPanel != null) { myToolWindowPanel.resetViewImmediatelyAndRefreshLater(); } }
resetViewImmediatelyAndRefreshLater
260,295
void (@NotNull Content content) { ChangesViewManager viewManager = (ChangesViewManager)getInstance(myProject); ChangesViewToolWindowPanel panel = viewManager.initToolWindowPanel(); content.setHelpId(ChangesListView.HELP_ID); content.setComponent(panel); content.setPreferredFocusableComponent(panel.myView); }
initTabContent
260,296
ChangesGroupingSupport () { // can't install support here - 'rebuildTree' is not defined return new ChangesGroupingSupport(myProject, this, true); }
installGroupingSupport
260,297
void (@NotNull JTree tree, int keepSelectionLevel) { super.collapseAll(tree, 2); TreeUtil.expand(tree, 1); }
collapseAll
260,298
boolean () { if (myToolWindowPanel == null) return false; return myToolWindowPanel.mySplitterDiffPreview != null || myToolWindowPanel.myEditorDiffPreview != null && ChangesViewToolWindowPanel.isOpenEditorDiffPreviewWithSingleClick.asBoolean(); }
isDiffPreviewAvailable
260,299
void (boolean state) { if (myToolWindowPanel == null) return; DiffPreview preview = ObjectUtils.chooseNotNull(myToolWindowPanel.mySplitterDiffPreview, myToolWindowPanel.myEditorDiffPreview); DiffPreview.setPreviewVisible(preview, state); myToolWindowPanel.setCommitSplitOrientation(); }
diffPreviewChanged