Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
263,500
int () { return myStartLineAfter; }
getStartLineAfter
263,501
List<String> () { return myContextBefore; }
getContextBefore
263,502
List<String> () { return myContextAfter; }
getContextAfter
263,503
List<BeforeAfter<List<String>>> () { return myPatchSteps; }
getPatchSteps
263,504
List<String> () { final ArrayList<String> after = new ArrayList<>(); for (BeforeAfter<List<String>> step : myPatchSteps) { after.addAll(step.getAfter()); } return after; }
getAfterAll
263,505
List<String> () { return myList; }
getList
263,506
void (final int size) { assert size > 0 && size < myList.size(); myList = new ArrayList<>(myList.subList(0, size)); }
cutToSize
263,507
boolean () { return myHaveAlreadyApplied; }
isHaveAlreadyApplied
263,508
boolean () { return myPlaceCoincide; }
isPlaceCoincide
263,509
boolean () { return myChangedCoincide; }
isChangedCoincide
263,510
HunksComparator () { return ourInstance; }
getInstance
263,511
int (SplitHunk o1, SplitHunk o2) { return Integer.compare(o1.getStartLineBefore(), o2.getStartLineBefore()); }
compare
263,512
ApplyPatchForBaseRevisionTexts () { return null; }
getMergeData
263,513
ApplyPatchStatus () { return myStatus; }
getStatus
263,514
String (@NotNull CharSequence text, @NotNull List<? extends PatchHunk> hunks) { return new PlainSimplePatchApplier(text, hunks).execute(); }
apply
263,515
String () { if (myHunks.isEmpty()) return myText.toString(); try { for (PatchHunk hunk : myHunks) { appendUnchangedLines(hunk.getStartLineBefore()); checkContextLines(hunk); applyChangedLines(hunk); } if (!handleLastLine()) { appendUnchangedLines(myLineOffsets.getLineCount()); } return sb.toString(); } catch (PatchAppl...
execute
263,516
boolean () { List<PatchLine> lastHunkLines = Objects.requireNonNull(ContainerUtil.getLastItem(myHunks)).getLines(); PatchLine lastBaseLine = ContainerUtil.findLast(lastHunkLines, line -> line.getType() != PatchLine.Type.ADD); PatchLine lastPatchedLine = ContainerUtil.findLast(lastHunkLines, line -> line.getType() != Pa...
handleLastLine
263,517
void (@NotNull PatchHunk hunk) { int baseStart = hunk.getStartLineBefore(); int baseEnd = hunk.getEndLineBefore(); int patchedStart = hunk.getStartLineAfter(); int patchedEnd = hunk.getEndLineAfter(); if (baseLine != baseStart) { error(VcsBundle.message("patch.simple.apply.hunk.base.start.error", baseLine, baseStart));...
checkContextLines
263,518
void (@NotNull PatchHunk hunk) { for (PatchLine patchLine : hunk.getLines()) { if (patchLine.getType() != PatchLine.Type.REMOVE) { appendLine(patchLine.getText()); } } baseLine = hunk.getEndLineBefore(); }
applyChangedLines
263,519
void (int untilLine) { if (baseLine > untilLine) { error(VcsBundle.message("patch.simple.apply.base.line.error", baseLine, untilLine)); } if (untilLine > myLineOffsets.getLineCount()) { error(VcsBundle.message("patch.simple.apply.base.line.total.error", myLineOffsets.getLineCount(), untilLine)); } for (int i = baseLine...
appendUnchangedLines
263,520
void (CharSequence lineContent) { if (patchedLine > 0) sb.append('\n'); sb.append(lineContent); patchedLine++; }
appendLine
263,521
CharSequence (int line) { return myText.subSequence(myLineOffsets.getLineStart(line), myLineOffsets.getLineEnd(line)); }
getLineContent
263,522
void (@NotNull String error) { throw new PatchApplyException(error); }
error
263,523
ApplyTextFilePatch (final TextFilePatch patch) { return new ApplyTextFilePatch(patch); }
create
263,524
ApplyBinaryFilePatch (final BinaryFilePatch patch) { return new ApplyBinaryFilePatch(patch); }
create
263,525
ApplyBinaryShelvedFilePatch (final ShelvedBinaryFilePatch patch) { return new ApplyBinaryShelvedFilePatch(patch); }
create
263,526
ApplyPatchForBaseRevisionTexts () { return ApplyPatchForBaseRevisionTexts.create(project, fileToPatch, pathBeforeRename, myPatch, baseContents != null ? baseContents.get() : null); }
getMergeData
263,527
int[] () { int[] result = new int[256]; Arrays.fill(result, -1); for (int i = 0; i < ALPHABET_85.length; i++) { result[ALPHABET_85[i]] = i; } return result; }
initIndexOfChar
263,528
Document () { return myDocument; }
getDocument
263,529
String () { return myDescription; }
getDescription
263,530
TextRange () { return myTextRange; }
getTextRange
263,531
HighlightSeverity () { return mySeverity; }
getSeverity
263,532
int () { return getDocument().getLineNumber(getTextRange().getStartOffset()); }
getStartLine
263,533
int () { return getTextRange().getStartOffset() - getDocument().getLineStartOffset(getStartLine()); }
getStartColumn
263,534
VcsFacadeImpl () { return (VcsFacadeImpl)VcsFacade.getInstance(); }
getVcsInstance
263,535
boolean (@NotNull Project project) { return ProjectLevelVcsManager.getInstance(project).hasActiveVcss(); }
hasActiveVcss
263,536
boolean (@NotNull PsiFile file) { final Project project = file.getProject(); final VirtualFile virtualFile = file.getVirtualFile(); if (virtualFile != null) { final Change change = ChangeListManager.getInstance(project).getChange(virtualFile); return change != null; } return false; }
hasChanges
263,537
boolean (@NotNull VirtualFile file, @NotNull Project project) { final Collection<Change> changes = ChangeListManager.getInstance(project).getChangesIn(file); for (Change change : changes) { if (change.getType() == Change.Type.DELETED) continue; return true; } return false; }
hasChanges
263,538
Boolean (@NotNull PsiFile psiFile) { ProjectLevelVcsManager vcsManager = ProjectLevelVcsManager.getInstance(psiFile.getProject()); return vcsManager.getVcsFor(psiFile.getVirtualFile()) != null; }
isFileUnderVcs
263,539
Set<String> (@NotNull Project project) { return VcsUtil.getVcsIgnoreFileNames(project); }
getVcsIgnoreFileNames
263,540
ChangedRangesInfo (@NotNull PsiFile file) { Project project = file.getProject(); Document document = PsiDocumentManager.getInstance(project).getDocument(file); if (document == null) return null; LineStatusTracker<?> tracker = LineStatusTrackerManager.getInstance(project).getLineStatusTracker(document); List<? extends R...
getChangedRangesInfo
263,541
List<PsiFile> (@NotNull Project project, @NotNull List<? extends PsiDirectory> dirs) { ChangeListManager changeListManager = ChangeListManager.getInstance(project); Collection<Change> changes = new ArrayList<>(); for (PsiDirectory dir : dirs) { changes.addAll(changeListManager.getChangesIn(dir.getVirtualFile())); } ret...
getChangedFilesFromDirs
263,542
List<PsiFile> (@NotNull Project project, @NotNull Collection<? extends Change> changes) { PsiManager psiManager = PsiManager.getInstance(project); return ContainerUtil.mapNotNull(changes, change -> { VirtualFile vFile = change.getVirtualFile(); return vFile != null ? psiManager.findFile(vFile) : null; }); }
getChangedFiles
263,543
List<Range> (@NotNull Document document, @NotNull Change change) { String contentFromVcs = getRevisionedContentFrom(change.getBeforeRevision()); if (contentFromVcs == null) return null; return computeRanges(document, contentFromVcs); }
getChangedRangesFromBeforeRevision
263,544
List<Range> (@NotNull Document document, @NotNull Change change) { String conventBefore = getRevisionedContentFrom(change.getBeforeRevision()); if (conventBefore == null) return null; String contentAfter = getRevisionedContentFrom(change.getAfterRevision()); if (contentAfter == null) return null; CharSequence beforeTex...
getChangedRangesForPostCommit
263,545
BitSet (@NotNull List<? extends Range> ranges) { BitSet changedLines = new BitSet(); for (Range range : ranges) { if (range.hasLines()) { changedLines.set(range.getLine1(), range.getLine2()); } else { // mark unchanged lines around deleted lines as modified changedLines.set(Math.max(0, range.getLine1() - 1), range.getL...
createChangedLinesBitSet
263,546
boolean (@NotNull PsiElement element, @NotNull Document document, @NotNull BitSet changedLines) { TextRange textRange = element.getTextRange(); int startLine = document.getLineNumber(textRange.getStartOffset()); int endLine = textRange.isEmpty() ? startLine + 1 : document.getLineNumber(textRange.getEndOffset() - 1) + 1...
isElementChanged
263,547
String (@Nullable ContentRevision contentRevision) { if (contentRevision == null) { return null; } try { return contentRevision.getContent(); } catch (VcsException e) { LOG.warn("Can't get content for: " + contentRevision, e); return null; } }
getRevisionedContentFrom
263,548
List<Range> (@NotNull Document document, @NotNull CharSequence contentFromVcs) { return RangesBuilder.createRanges(document.getImmutableCharSequence(), fixLineSeparators(contentFromVcs)); }
computeRanges
263,549
CharSequence (@NotNull CharSequence contentFromVcs) { return StringUtilRt.convertLineSeparators(contentFromVcs, "\n"); }
fixLineSeparators
263,550
int (@NotNull Document document, @NotNull CharSequence contentFromVcs) { List<Range> changedRanges = computeRanges(document, contentFromVcs); int linesChanges = 0; for (Range range : changedRanges) { int inserted = range.getLine2() - range.getLine1(); int deleted = range.getVcsLine2() - range.getVcsLine1(); linesChange...
calculateChangedLinesNumber
263,551
ChangedRangesInfo (@NotNull Document document, @NotNull List<? extends Range> changedRanges) { final List<TextRange> ranges = new ArrayList<>(); final List<TextRange> insertedRanges = new ArrayList<>(); for (Range range : changedRanges) { if (range.hasLines()) { int changeStartLine = range.getLine1(); int changeEndLine...
getChangedRangesInfo
263,552
boolean (@NotNull Project project, @NotNull PsiFile file) { if (isFileUnderVcs(file)) { FileStatus status = ChangeListManager.getInstance(project).getStatus(file.getVirtualFile()); return status == FileStatus.UNKNOWN || status == FileStatus.IGNORED; } return true; }
isChangeNotTrackedForFile
263,553
void (@NotNull Project project, @NotNull Document document, @NotNull Runnable o) { LineStatusTracker<?> tracker = LineStatusTrackerManager.getInstance(project).getLineStatusTracker(document); if (tracker != null) { tracker.doFrozen(o); } else { o.run(); } }
runHeavyModificationTask
263,554
void (@NotNull Project project, @NotNull List<? extends VirtualFile> virtualFiles) { VcsFileUtil.markFilesDirty(project, virtualFiles); }
markFilesDirty
263,555
JComponent (@NotNull Project project, @NotNull ModelPatch patch) { List<Change> changes = EntryStream.of(patch.getBranchChanges()).mapKeyValue((file, content) -> { FilePath filePath = VcsUtil.getFilePath(file); ContentRevision current = new CurrentContentRevision(filePath); ContentRevision changed = new SimpleContentRe...
createPatchPreviewComponent
263,556
void (@NotNull PsiReferenceRegistrar registrar) { registrar.registerReferenceProvider(new PsiElementPattern.Capture<>(PsiElement.class) { @Override public boolean accepts(@Nullable Object o, ProcessingContext context) { return o instanceof PsiLiteralValue && ((PsiLiteralValue)o).getValue() instanceof String; } }, new A...
registerReferenceProviders
263,557
boolean (@Nullable Object o, ProcessingContext context) { return o instanceof PsiLiteralValue && ((PsiLiteralValue)o).getValue() instanceof String; }
accepts
263,558
CachedValue<PsiReference[]> (final PsiElement element, Object p) { return CachedValuesManager.getManager(element.getProject()).createCachedValue(() -> { IssueNavigationConfiguration navigationConfiguration = IssueNavigationConfiguration.getInstance(element.getProject()); if (navigationConfiguration == null) { return Ca...
compute
263,559
boolean (@NotNull PsiElement target) { return false; }
acceptsTarget
263,560
VcsScopeItem (Project project) { if (ChangeListManager.getInstance(project).getAffectedFiles().isEmpty()) { return null; } return new VcsScopeItem(project); }
createIfHasVCS
263,561
AnalysisScope () { ChangeList changeList = myModel != null ? (ChangeList)myModel.getSelectedItem() : null; List<VirtualFile> files; if (changeList == null) { files = myChangeListManager.getAffectedFiles(); } else { LocalChangeList list = myChangeListManager.findChangeList(changeList.getName()); if (list != null) { file...
getScope
263,562
DefaultComboBoxModel<LocalChangeList> () { return myModel; }
getChangeListsModel
263,563
int () { return AnalysisScope.UNCOMMITTED_FILES; }
getScopeId
263,564
JRadioButton (ModelScopeItem m) { JRadioButton button = new JRadioButton(); button.setText(CodeInsightBundle.message("scope.option.uncommitted.files")); return button; }
getButton
263,565
List<JComponent> (JRadioButton button, ModelScopeItem m, Disposable dialogDisposable) { VcsScopeItem model = (VcsScopeItem)m; DefaultComboBoxModel<LocalChangeList> comboBoxModel = model.getChangeListsModel(); if (comboBoxModel == null) { return Collections.emptyList(); } ComboBox<LocalChangeList> comboBox = new ComboBo...
getAdditionalComponents
263,566
boolean (ModelScopeItem model) { return model instanceof VcsScopeItem; }
isApplicable
263,567
boolean () { return myMode != Mode.DISABLED; }
isEnabled
263,568
void (@NotNull Project project, @NotNull @NlsContexts.DialogTitle String dialogTitle, @NotNull LocalContent localContent, @NotNull ThrowableComputable<? extends Collection<Change>, ? extends VcsException> changesLoader) { if (localContent != LocalContent.NONE) { FileDocumentManager.getInstance().saveAllDocuments(); } i...
showChanges
263,569
void (@NotNull Project project, @NotNull @NlsContexts.DialogTitle String dialogTitle, @NotNull LocalContent localContent, @NotNull ThrowableComputable<? extends Collection<Change>, ? extends VcsException> changesLoader) { MyLoadingChangesPanel changesPanel = createPanel(project, localContent, changesLoader); DialogBuil...
showDialog
263,570
void (@NotNull Project project, @NotNull @NlsContexts.DialogTitle String dialogTitle, @NotNull LocalContent localContent, @NotNull ThrowableComputable<? extends Collection<Change>, ? extends VcsException> changesLoader) { MyLoadingChangesPanel changesPanel = createPanel(project, localContent, changesLoader); ChangesBro...
showAsTab
263,571
MyLoadingChangesPanel ( @NotNull Project project, @NotNull LocalContent localContent, @NotNull ThrowableComputable<? extends Collection<Change>, ? extends VcsException> changesLoader ) { MyChangesBrowser changesBrowser = new MyChangesBrowser(project, localContent); MyLoadingChangesPanel changesPanel = new MyLoadingChan...
createPanel
263,572
void () { }
dispose
263,573
ChangesBrowserBase () { return myChangesBrowser; }
getChangesBrowser
263,574
void () { myLoadingPanel.loadChangesInBackground(this::loadChanges, this::applyResult); }
reloadChanges
263,575
void (@Nullable Collection<? extends Change> changes) { myChangesBrowser.setChangesToDisplay(changes != null ? changes : Collections.emptyList()); }
applyResult
263,576
Object (@NotNull String dataId) { if (DATA_KEY.is(dataId)) { return this; } return null; }
getData
263,577
void () { shutdown(); }
dispose
263,578
List<AnAction> () { List<AnAction> actions = new ArrayList<>(); actions.add(new MyRefreshAction()); actions.addAll(super.createToolbarActions()); actions.add(ActionManager.getInstance().getAction("Vcs.GetVersion")); return actions; }
createToolbarActions
263,579
List<AnAction> () { return ContainerUtil.append( super.createPopupMenuActions(), ActionManager.getInstance().getAction("ChangesView.CreatePatchFromChanges"), ActionManager.getInstance().getAction("Vcs.GetVersion") ); }
createPopupMenuActions
263,580
boolean (@NotNull AnActionEvent e) { return e.getData(MyLoadingChangesPanel.DATA_KEY) != null; }
isActive
263,581
ActionUpdateThread () { return ActionUpdateThread.EDT; }
getActionUpdateThread
263,582
void (@NotNull AnActionEvent e) { Project project = e.getProject(); MyLoadingChangesPanel changesPanel = e.getData(MyLoadingChangesPanel.DATA_KEY); if (project == null || changesPanel == null) { e.getPresentation().setEnabledAndVisible(false); return; } MyChangesBrowser browser = ObjectUtils.tryCast(changesPanel.getCha...
update
263,583
void (@NotNull AnActionEvent e) { Project project = Objects.requireNonNull(e.getProject()); MyLoadingChangesPanel changesPanel = e.getRequiredData(MyLoadingChangesPanel.DATA_KEY); MyChangesBrowser browser = (MyChangesBrowser)changesPanel.getChangesBrowser(); List<FileRevisionProvider> fileContentProviders = ContainerUt...
actionPerformed
263,584
FilePath () { return ChangesUtil.getFilePath(myChange); }
getFilePath
263,585
ActionUpdateThread () { return ActionUpdateThread.EDT; }
getActionUpdateThread
263,586
void (@NotNull AnActionEvent e) { MyLoadingChangesPanel changesPanel = e.getData(MyLoadingChangesPanel.DATA_KEY); if (changesPanel == null) { e.getPresentation().setEnabledAndVisible(false); return; } MyChangesBrowser browser = ObjectUtils.tryCast(changesPanel.getChangesBrowser(), MyChangesBrowser.class); e.getPresenta...
update
263,587
void (@NotNull AnActionEvent e) { MyLoadingChangesPanel changesPanel = e.getRequiredData(MyLoadingChangesPanel.DATA_KEY); FileDocumentManager.getInstance().saveAllDocuments(); changesPanel.reloadChanges(); }
actionPerformed
263,588
VcsRevisionNumber () { return myRevisionNumber; }
getRevisionNumber
263,589
long (@NotNull VcsRevisionNumber number) { if (number instanceof LongRevisionNumber) return ((LongRevisionNumber)number).getLongRevisionNumber(); return 0; }
getLong
263,590
void () { notification.expire(); }
dispose
263,591
void (@NotNull AnActionEvent e, @NotNull Notification notification) { focusUpdateInfoTree(myProject, myTree); notification.expire(); }
actionPerformed
263,592
void (@NotNull Project project, @NotNull UpdateInfoTree updateInfoTree) { ToolWindowManager.getInstance(project).getToolWindow(ChangesViewContentManager.TOOLWINDOW_ID).activate(() -> { ContentManager contentManager = ProjectLevelVcsManagerEx.getInstanceEx(project).getContentManager(); if (contentManager != null) Conten...
focusUpdateInfoTree
263,593
void () { synchronized (myLock) { myIsStarted = true; } startProgressIfNeeded(); }
start
263,594
void () { if (myProject.isDisposed()) return; synchronized (myLock) { if (!myIsStarted || myActive || myQueue.isEmpty()) return; myActive = true; } new Task.Backgroundable(myProject, myTitle) { @Override public void run(@NotNull ProgressIndicator indicator) { pumpQueue(); } }.queue(); }
startProgressIfNeeded
263,595
void (@NotNull ProgressIndicator indicator) { pumpQueue(); }
run
263,596
void (@NotNull final Runnable stuff) { if (ApplicationManager.getApplication().isHeadlessEnvironment()) { stuff.run(); return; } synchronized (myLock) { myQueue.add(stuff); } startProgressIfNeeded(); }
run
263,597
void () { while (true) { final Runnable stuff; synchronized (myLock) { stuff = myQueue.poll(); if (stuff == null) { // queue is empty, stop progress myActive = false; return; } } // each task is executed only once, once it has been taken from the queue.. try { stuff.run(); } catch (ProcessCanceledException ignored) { }...
pumpQueue
263,598
HighlightDisplayKey () { return myDefaultDescriptor.getKey(); }
getKey
263,599
void () { mySeverityChooser.setChosen(ScopesAndSeveritiesTable.getSeverity(singletonList(myToolState))); enableChildren(myToolState.isEnabled(), myMainPanel.getComponent()); }
update