Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
260,400
void () { }
dispose
260,401
void () { myUpdater.waitForAllExecuted(10, TimeUnit.SECONDS); // wait for FileAnnotation.close()/reload() to be called - see invalidateAnnotations() if (getApplication().isDispatchThread()) { dispatchAllInvocationEvents(); } else { UIUtil.pump(); } }
calmDown
260,402
void () { final Set<String> paths; final Map<String, VcsRevisionNumber> changes; final Set<VirtualFile> files; Set<VcsKey> vcsToRefresh; synchronized (myLock) { vcsToRefresh = new HashSet<>(myVcsKeySet); paths = new HashSet<>(myDirtyPaths); changes = new HashMap<>(myDirtyChanges); files = new HashSet<>(myDirtyFiles); m...
updateStuff
260,403
void (@NotNull Set<String> removed, @NotNull Map<String, VcsRevisionNumber> refresh, @NotNull Set<? extends VirtualFile> files) { for (String path : removed) { refreshForPath(path, null); } for (Map.Entry<String, VcsRevisionNumber> entry : refresh.entrySet()) { refreshForPath(entry.getKey(), entry.getValue()); } for (V...
checkByDirtyScope
260,404
void (@NotNull VirtualFile file) { final MultiMap<VirtualFile, FileAnnotation> annotations = new MultiMap<>(); synchronized (myLock) { for (FileAnnotation fileAnnotation : myFileAnnotations) { VirtualFile virtualFile = fileAnnotation.getFile(); if (virtualFile != null && virtualFile.isInLocalFileSystem() && VfsUtilCore...
processUnderFile
260,405
void (@NotNull String path, @Nullable VcsRevisionNumber number) { final File file = new File(path); VirtualFile vf = myLocalFileSystem.findFileByIoFile(file); if (vf == null) { vf = myLocalFileSystem.refreshAndFindFileByIoFile(file); } if (vf == null) return; processFile(number, vf); }
refreshForPath
260,406
void (@Nullable VcsRevisionNumber number, @NotNull VirtualFile vf) { final Collection<FileAnnotation> annotations; synchronized (myLock) { annotations = ContainerUtil.filter(myFileAnnotations, it -> vf.equals(it.getFile())); } if (!annotations.isEmpty()) { if (number == null) { number = fromDiffProvider(vf); } if (numb...
processFile
260,407
VcsRevisionNumber (@NotNull VirtualFile vf) { final VcsRoot vcsRoot = myVcsManager.getVcsRootObjectFor(vf); DiffProvider diffProvider; if (vcsRoot != null && vcsRoot.getVcs() != null && (diffProvider = vcsRoot.getVcs().getDiffProvider()) != null) { return diffProvider.getCurrentRevision(vf); } return null; }
fromDiffProvider
260,408
void (@NotNull Set<VcsKey> refresh) { if (refresh.isEmpty()) return; synchronized (myLock) { List<FileAnnotation> copy = ContainerUtil.filter(myFileAnnotations, it -> refresh.contains(it.getVcsKey())); invalidateAnnotations(copy, false); } }
closeForVcs
260,409
void (@NotNull VirtualFile file, @Nullable VcsKey vcsKey) { synchronized (myLock) { Collection<FileAnnotation> copy = ContainerUtil.filter(myFileAnnotations, it -> file.equals(it.getFile()) && (vcsKey == null || vcsKey.equals(it.getVcsKey()))); invalidateAnnotations(copy, false); } }
invalidateAnnotationsFor
260,410
void (@NotNull Collection<? extends FileAnnotation> annotations, boolean reload) { if (annotations.isEmpty()) return; getApplication().invokeLater(() -> { for (FileAnnotation annotation : annotations) { try { if (reload) { annotation.reload(null); } else { annotation.close(); } } catch (Exception e) { LOG.error(e); } }...
invalidateAnnotations
260,411
void (@NotNull FileAnnotation annotation) { synchronized (myLock) { myFileAnnotations.add(annotation); } }
registerAnnotation
260,412
void (@NotNull FileAnnotation annotation) { synchronized (myLock) { myFileAnnotations.remove(annotation); } }
unregisterAnnotation
260,413
void () { synchronized (myLock) { List<FileAnnotation> copy = new ArrayList<>(myFileAnnotations); invalidateAnnotations(copy, true); } }
reloadAnnotations
260,414
void (@NotNull VcsKey key) { synchronized (myLock) { List<FileAnnotation> copy = ContainerUtil.filter(myFileAnnotations, it -> key.equals(it.getVcsKey())); invalidateAnnotations(copy, true); } }
reloadAnnotationsForVcs
260,415
void () { myUpdater.queue(myUpdateStuff); }
scheduleUpdate
260,416
void (VirtualFile file) { if (file == null) return; synchronized (myLock) { myDirtyFiles.add(file); } scheduleUpdate(); }
dirtyUnder
260,417
void (@NotNull BaseRevision currentRevision) { synchronized (myLock) { myDirtyChanges.put(currentRevision.getPath(), currentRevision.getRevision()); } scheduleUpdate(); }
dirty
260,418
void (@NotNull String path) { synchronized (myLock) { myDirtyPaths.add(path); } scheduleUpdate(); }
dirty
260,419
void (@NotNull VcsKey vcsKey) { synchronized (myLock) { myVcsKeySet.add(vcsKey); } scheduleUpdate(); }
configurationChanged
260,420
void (@NotNull DefaultActionGroup group) { group.add(getUnversionedToolbarGroup()); myView.installPopupHandler(registerUnversionedPopupGroup(myView)); }
addCustomActions
260,421
ActionGroup () { return (ActionGroup)ActionManager.getInstance().getAction(TOOLBAR_GROUP); }
getUnversionedToolbarGroup
260,422
ActionGroup () { return (ActionGroup)ActionManager.getInstance().getAction(POPUP_GROUP); }
getUnversionedPopupGroup
260,423
ActionGroup (@NotNull JComponent component) { ActionGroup popupGroup = getUnversionedPopupGroup(); recursiveRegisterShortcutSet(popupGroup, component, null); return popupGroup; }
registerUnversionedPopupGroup
260,424
List<FilePath> () { return ChangeListManager.getInstance(myProject).getUnversionedFilesPaths(); }
getFiles
260,425
void () { if (!myActive.get() || project.isDisposed()) return; try { shouldBeContinued = callback.get(); } catch (ProcessCanceledException e) { return; } catch (RuntimeException e) { LOG.info(e); } if (!shouldBeContinued) { myActive.set(false); } else { mySimpleAlarm.addRequest(myRunnable, myRefreshInterval); } }
run
260,426
void () { if (myActive.compareAndSet(false, true)) { mySimpleAlarm.addRequest(myRunnable, myRefreshInterval); } }
startIfNotStarted
260,427
void () { myActive.set(false); }
stop
260,428
boolean (final VirtualFile file) { for (String path : myPaths) { if (VfsUtilCore.isAncestorOrSelf(path, file)) { return false; } } myPaths.add(file.getPath()); return true; }
addCurrent
260,429
String () { return "NOT_LOADED"; }
asString
260,430
int (@NotNull VcsRevisionNumber o) { return o == this ? 0 : -1; }
compareTo
260,431
String () { return "UNKNOWN"; }
asString
260,432
int (@NotNull VcsRevisionNumber o) { return o == this ? 0 : -1; }
compareTo
260,433
boolean () { mySomethingChanged = false; // copy under lock final HashMap<VcsRoot, LazyRefreshingSelfQueue> copyMap; synchronized (myLock) { copyMap = new HashMap<>(myRefreshingQueues); } // filter only items for vcs roots that support background operations for (Iterator<Map.Entry<VcsRoot, LazyRefreshingSelfQueue>> ite...
updateStep
260,434
void () { // copy myData under lock HashSet<String> keys; synchronized (myLock) { keys = new HashSet<>(myData.keySet()); } // collect new vcs for scheduled files final Map<String, Pair<VirtualFile, AbstractVcs>> vFiles = new HashMap<>(); for (String key : keys) { final VirtualFile vf = LocalFileSystem.getInstance().ref...
directoryMappingChanged
260,435
void (final VcsRoot oldVcsRoot, final VcsRoot newVcsRoot, final String key) { synchronized (myLock) { final LazyRefreshingSelfQueue<String> oldQueue = getQueue(oldVcsRoot); final LazyRefreshingSelfQueue<String> newQueue = getQueue(newVcsRoot); myData.put(key, Pair.create(newVcsRoot, NOT_LOADED)); oldQueue.forceRemove(k...
switchVcs
260,436
void (@NotNull String path, @NotNull AbstractVcs vcs) { // does not support if (vcs.getDiffProvider() == null) return; final VirtualFile root = getVcsRootFor(myProject, getFilePath(path, false)); if (root == null) return; final VcsRoot vcsRoot = new VcsRoot(vcs, root); synchronized (myLock) { final Pair<VcsRoot, VcsRev...
changeUpdated
260,437
void (final Collection<String> paths) { synchronized (myLock) { for (String path : paths) { final Pair<VcsRoot, VcsRevisionNumber> pair = myData.remove(path); if (pair != null) { // vcs [root] seems to not change final VcsRoot vcsRoot = pair.getFirst(); final LazyRefreshingSelfQueue<String> queue = getQueue(vcsRoot); q...
invalidate
260,438
void (@NotNull String path, @NotNull AbstractVcs vcs) { // does not support if (vcs.getDiffProvider() == null) return; final VirtualFile root = getVcsRootFor(myProject, getFilePath(path, false)); if (root == null) return; final LazyRefreshingSelfQueue<String> queue; synchronized (myLock) { queue = getQueue(new VcsRoot(...
changeRemoved
260,439
LazyRefreshingSelfQueue<String> (final VcsRoot vcsRoot) { synchronized (myLock) { LazyRefreshingSelfQueue<String> queue = myRefreshingQueues.get(vcsRoot); if (queue != null) return queue; queue = new LazyRefreshingSelfQueue<>( () -> { int interval = VcsConfiguration.getInstance(myProject).CHANGED_ON_SERVER_INTERVAL; re...
getQueue
260,440
void (String s) { LOG.debug("update for: " + s); //todo check canceled - check VCS's ready for asynchronous queries // get last remote revision for file final VirtualFile vf = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(new File(s)); final ItemLatestState state; final DiffProvider diffProvider = myVcsRoot....
consume
260,441
Boolean () { final AbstractVcs vcs = myVcsRoot.getVcs(); // won't be called in parallel for same vcs -> just synchronized map is ok final String vcsName = vcs.getName(); LOG.debug("should update for: " + vcsName + " root: " + myVcsRoot.getPath().getPath()); final VcsRevisionNumber latestNew = vcs.getDiffProvider().getL...
compute
260,442
VcsRevisionNumber (final String path) { synchronized (myLock) { final Pair<VcsRoot, VcsRevisionNumber> pair = myData.get(path); return pair == null ? NOT_LOADED : pair.getSecond(); } }
getNumber
260,443
boolean (@NotNull Change change, @NotNull AbstractVcs vcs) { if (change.getBeforeRevision() != null && change.getAfterRevision() != null && (! change.isMoved()) && (! change.isRenamed())) { return getRevisionState(change.getBeforeRevision()); } return getRevisionState(change.getBeforeRevision()) && getRevisionState(cha...
isUpToDate
260,444
boolean (final ContentRevision revision) { if (revision != null) { // TODO: Seems peg revision should also be tracked here. final VcsRevisionNumber local = revision.getRevisionNumber(); final String path = revision.getFile().getPath(); final VcsRevisionNumber remote = getNumber(path); return NOT_LOADED == remote || UNK...
getRevisionState
260,445
VcsDirtyScopeVfsListener (@NotNull Project project) { return project.getService(VcsDirtyScopeVfsListener.class); }
getInstance
260,446
void (@NotNull Project project) { getInstance(project); }
install
260,447
void (boolean forbid) { myForbid = forbid; }
setForbid
260,448
void () { }
dispose
260,449
void () { AsyncVfsEventsPostProcessorImpl.waitEventsProcessed(); }
waitForAsyncTaskCompletion
260,450
void (@NotNull List<? extends @NotNull VFileEvent> events) { ProjectLevelVcsManager vcsManager = ProjectLevelVcsManager.getInstance(myProject); if (myForbid || !vcsManager.hasActiveVcss()) return; final FilesAndDirs dirtyFilesAndDirs = new FilesAndDirs(); // collect files and directories - sources of events for (VFileE...
filesChanged
260,451
void (@NotNull ProjectLevelVcsManager vcsManager, @NotNull FilesAndDirs filesAndDirs, @NotNull FilePath filePath, boolean withParentDirectory) { VcsRoot vcsRoot = vcsManager.getVcsRootObjectFor(filePath); AbstractVcs vcs = vcsRoot != null ? vcsRoot.getVcs() : null; if (vcsRoot == null || vcs == null) return; if (filePa...
add
260,452
void (@NotNull ProjectLevelVcsManager vcsManager, @NotNull FilesAndDirs filesAndDirs, @NotNull FilePath filePath) { add(vcsManager, filesAndDirs, filePath, false); }
add
260,453
void (@NotNull ProjectLevelVcsManager vcsManager, @NotNull FilesAndDirs filesAndDirs, @NotNull FilePath filePath) { add(vcsManager, filesAndDirs, filePath, true); }
addWithParentDirectory
260,454
Object (@NotNull DataProvider dataProvider) { return getChangesSelection(dataProvider); }
getData
260,455
ListSelection<Change> (@NotNull DataProvider dataProvider) { Change[] selectedChanges = VcsDataKeys.SELECTED_CHANGES.getData(dataProvider); if (selectedChanges != null) { return ListSelection.createAt(Arrays.asList(selectedChanges), 0) .asExplicitSelection(); } Change[] changes = VcsDataKeys.CHANGES.getData(dataProvide...
getChangesSelection
260,456
void () { myMap.clear(); }
cleanAll
260,457
void (@NotNull VcsDirtyScope scope) { if (myProject.isDisposed()) return; final Iterator<VirtualFile> iterator = myMap.keySet().iterator(); while (iterator.hasNext()) { final VirtualFile file = iterator.next(); if (isFileDirty(scope, file)) { iterator.remove(); } } }
cleanUnderScope
260,458
boolean (final VcsDirtyScope scope, final VirtualFile file) { if (scope == null) return true; if (fileDropped(file)) return true; return scope.belongsTo(VcsUtil.getFilePath(file)); }
isFileDirty
260,459
boolean (final VirtualFile file) { return !file.isValid() || myVcsManager.getVcsFor(file) == null; }
fileDropped
260,460
boolean () { return myMap.isEmpty(); }
isEmpty
260,461
Collection<VirtualFile> () { return myMap.keySet(); }
values
260,462
void (final VirtualFile file, final String branch, final boolean recursive) { // without optimization here myMap.put(file, new Pair<>(recursive, branch)); }
addFile
260,463
void (@NotNull final VirtualFile file) { myMap.remove(file); }
removeFile
260,464
String (final VirtualFile file) { final VirtualFile floor = myMap.floorKey(file); if (floor == null) return null; final SortedMap<VirtualFile, Pair<Boolean, String>> floorMap = myMap.headMap(floor); for (VirtualFile parent : floorMap.keySet()) { if (VfsUtilCore.isAncestor(parent, file, false)) { return floorMap.get(par...
getBranchForFile
260,465
boolean (final Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; final SwitchedFileHolder that = (SwitchedFileHolder)o; return Iterables.elementsEqual(myMap.entrySet(), that.myMap.entrySet()); }
equals
260,466
int () { return myMap.hashCode(); }
hashCode
260,467
boolean (DnDEvent event) { boolean isDropPossible = isDropPossible(event); event.setDropPossible(isDropPossible); if (isDropPossible) { if (myAlarm.isEmpty()) { myAlarm.request(); } } else { myAlarm.cancelAllRequests(); } return !isDropPossible; }
update
260,468
void () { myAlarm.cancelAllRequests(); }
cleanUpOnLeave
260,469
void (DnDEvent event) { myAlarm.cancelAllRequests(); }
drop
260,470
void (@NotNull VcsRoot vcs, @NotNull FilePath filePath) { Set<FilePath> set = getVcsPathsSet(vcs); set.add(filePath); }
add
260,471
void (@NotNull VcsDirtyScopeMap map) { for (Map.Entry<VcsRoot, Set<FilePath>> entry : map.myMap.entrySet()) { Set<FilePath> set = getVcsPathsSet(entry.getKey()); set.addAll(entry.getValue()); } }
addAll
260,472
Set<FilePath> (@NotNull VcsRoot vcsRoot) { return myMap.computeIfAbsent(vcsRoot, key -> { HashingStrategy<FilePath> strategy = getDirtyScopeHashingStrategy(Objects.requireNonNull(key.getVcs())); return strategy == null ? new HashSet<>() : CollectionFactory.createCustomHashingStrategySet(strategy); }); }
getVcsPathsSet
260,473
boolean () { return myMap.isEmpty(); }
isEmpty
260,474
void () { myMap.clear(); }
clear
260,475
void (@NotNull FilePath filePath) { // do not store 'subString' to reduce memory footprint CharSequence parent = PathUtilRt.getParentPathSequence(new CharSequenceSubSequence(filePath.getPath())); if (parent.isEmpty()) return; myDirectParents.add(parent); while (!parent.isEmpty()) { boolean wasAdded = myAllPaths.add(par...
add
260,476
ThreeState (@NotNull FilePath filePath) { String path = filePath.getPath(); if (myDirectParents.contains(path)) return ThreeState.YES; if (myAllPaths.contains(path)) return ThreeState.UNSURE; return ThreeState.NO; }
haveChangesUnder
260,477
Callback (@NotNull Project project, @NotNull InvokeAfterUpdateMode mode, @NotNull Runnable afterUpdate, @Nullable @Nls String title) { if (mode.isSilent()) { return new SilentCallback(project, afterUpdate, mode.isCallbackOnAwt()); } else { return new ProgressCallback(project, afterUpdate, mode.isSynchronous(), mode.isC...
create
260,478
void () { LOG.debug("changes update finished for project " + myProject.getName()); if (!myProject.isDisposed()) myAfterUpdate.run(); }
invokeCallback
260,479
void () { }
startProgress
260,480
void () { scheduleCallback(); }
endProgress
260,481
void () { scheduleCallback(); }
handleStoppedQueue
260,482
void () { if (myCallbackOnAwt) { ApplicationManager.getApplication().invokeLater(this::invokeCallback); } else { ApplicationManager.getApplication().executeOnPooledThread(this::invokeCallback); } }
scheduleCallback
260,483
void () { if (mySynchronous) { String dialogTitle = VcsBundle.message("change.list.manager.wait.lists.synchronization.modal", myTitle, myTitle != null ? 1 : 0); new ModalWaiter(myProject, dialogTitle, myCanBeCancelled).queue(); } else { String progressTitle = VcsBundle.message("change.list.manager.wait.lists.synchroniz...
startProgress
260,484
void () { mySemaphore.up(); }
endProgress
260,485
void () { ApplicationManager.getApplication().invokeLater(this::invokeCallback); }
handleStoppedQueue
260,486
void (@NotNull ProgressIndicator indicator) { indicator.setIndeterminate(true); indicator.setText2(VcsBundle.message("commit.wait.util.synched.text")); ProgressIndicatorUtils.awaitWithCheckCanceled(mySemaphore, indicator); }
awaitSemaphore
260,487
void (@NotNull ProgressIndicator indicator) { awaitSemaphore(indicator); }
run
260,488
void () { invokeCallback(); }
onFinished
260,489
void (@NotNull ProgressIndicator indicator) { awaitSemaphore(indicator); }
run
260,490
void () { invokeCallback(); }
onSuccess
260,491
boolean () { return false; }
isHeadless
260,492
void (final Collection<String> paths) { synchronized (myLock) { for (String path : paths) { myChanged.remove(path); } } }
invalidate
260,493
boolean (@NotNull Change change, @NotNull AbstractVcs vcs) { if (!isSupportedFor(vcs)) return true; final List<File> files = ChangesUtil.getIoFilesFromChanges(Collections.singletonList(change)); synchronized (myLock) { for (File file : files) { final String path = file.getAbsolutePath(); final Pair<Boolean, VcsRoot> da...
isUpToDate
260,494
void (@NotNull String path, @NotNull AbstractVcs vcs) { if (!isSupportedFor(vcs)) return; final VirtualFile root = getVcsRootFor(myProject, getFilePath(path, false)); if (root == null) return; synchronized (myLock) { myQueries.putValue(new VcsRoot(vcs, root), path); } }
changeUpdated
260,495
void (@NotNull String path, @NotNull AbstractVcs vcs) { if (!isSupportedFor(vcs)) return; final VirtualFile root = getVcsRootFor(myProject, getFilePath(path, false)); if (root == null) return; synchronized (myLock) { final VcsRoot key = new VcsRoot(vcs, root); if (myQueries.containsKey(key)) { myQueries.remove(key, pat...
changeRemoved
260,496
void () { // todo will work? synchronized (myLock) { myChanged.clear(); myTs.clear(); } }
directoryMappingChanged
260,497
boolean () { final MultiMap<VcsRoot, String> dirty = new MultiMap<>(); int interval = VcsConfiguration.getInstance(myProject).CHANGED_ON_SERVER_INTERVAL; final long oldPoint = System.currentTimeMillis() - (interval > 0 ? interval * 60000L : DISCRETE); synchronized (myLock) { // just copies myQueries MultiMap to dirty M...
updateStep
260,498
boolean (@NotNull AbstractVcs vcs) { return vcs.getTreeDiffProvider() != null; }
isSupportedFor
260,499
FilePath () { return myFile; }
getFile