Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
261,200
List<String> () { return myContextBefore; }
getContextBefore
261,201
List<String> () { return myContextAfter; }
getContextAfter
261,202
List<String> () { return myDeletedLines; }
getDeletedLines
261,203
List<String> () { return myInsertedLines; }
getInsertedLines
261,204
DiffRequest (@Nullable Project project, @Nullable VirtualFile file, @NotNull List<String> contents, @Nullable @NlsContexts.DialogTitle String windowTitle, @NotNull List<@NlsContexts.Label String> titles) { assert contents.size() == 3; assert titles.size() == 3; if (windowTitle == null) windowTitle = getPatchTitle(file)...
createDiffRequest
261,205
DiffRequest (@Nullable Project project, @NotNull VirtualFile file, @NotNull @NonNls String localContent, @NotNull AppliedTextPatch textPatch, @Nullable @NlsContexts.DialogTitle String windowTitle, @Nullable @NlsContexts.Label String localTitle, @Nullable @NlsContexts.Label String resultTitle, @Nullable @NlsContexts.Lab...
createBadDiffRequest
261,206
String (@Nullable VirtualFile file) { if (file != null) { return VcsBundle.message("patch.apply.bad.diff.to.title", getPresentablePath(file)); } else { return VcsBundle.message("patch.apply.bad.diff.title"); } }
getBadPatchTitle
261,207
String (@NotNull VirtualFile file) { String fullPath = file.getParent() == null ? file.getPresentableUrl() : file.getParent().getPresentableUrl(); return file.getName() + " (" + fullPath + ")"; }
getPresentablePath
261,208
ContentRevision () { if (FilePatchStatus.DELETED.equals(myStatus)) { return null; } if (myNewContentRevision == null) { myConflicts = null; final FilePath newFilePath = getFilePath(); if (FilePatchStatus.ADDED.equals(myStatus)) { final String content = myPatch.getSingleHunkPatchText(); myNewContentRevision = new Simple...
getNewContentRevision
261,209
DiffRequestProducer (final Project project, final PatchReader patchReader) { PatchChange change = getChange(); FilePatch patch = getPatch(); String path = patch.getBeforeName() == null ? patch.getAfterName() : patch.getBeforeName(); return new DiffRequestProducer() { @NotNull @Override public DiffRequest process(@NotNu...
getDiffRequestProducers
261,210
String () { final File ioCurrentBase = getIoCurrentBase(); return ioCurrentBase == null ? getCurrentPath() : ioCurrentBase.getPath(); }
getName
261,211
FileType () { return getFilePath().getFileType(); }
getContentType
261,212
String (byte @NotNull [] bytes) { String prefix = "blob " + bytes.length + '\u0000'; //NON-NLS return Hashing.sha1().newHasher().putBytes(prefix.getBytes(Charsets.UTF_8)).putBytes(bytes).hash().toString(); }
getSha1
261,213
String () { // not used return null; }
getName
261,214
void (@NotNull List<? extends FilePatch> remaining, @NotNull MultiMap<VirtualFile, AbstractFilePatchInProgress<?>> patchGroupsToApply, @Nullable LocalChangeList localList, @Nullable String fileName, @Nullable ThrowableComputable<Map<String, Map<String, CharSequence>>, PatchSyntaxException> additionalInfo) { CommitConte...
apply
261,215
void (@NotNull ProgressIndicator indicator) { PatchApplier.executePatchGroup(appliers, localList); }
run
261,216
Collection<PatchApplier> (@NotNull MultiMap<VirtualFile, AbstractFilePatchInProgress<?>> patchGroups, @Nullable LocalChangeList localList, @NotNull CommitContext commitContext) { Collection<PatchApplier> appliers = new ArrayList<>(); for (VirtualFile base : patchGroups.keySet()) { appliers.add(new PatchApplier(myProjec...
getPatchAppliers
261,217
void (@NotNull Project project, @NotNull ThrowableComputable<? extends Map<String, Map<String, CharSequence>>, PatchSyntaxException> additionalInfo, @Nullable CommitContext commitContext) { List<PatchEP> extensions = PatchEP.EP_NAME.getExtensionList(); if (extensions.isEmpty()) { return; } try { Map<String, Map<String,...
applyAdditionalInfoBefore
261,218
Set<String> (@NotNull MultiMap<VirtualFile, AbstractFilePatchInProgress<?>> patchGroups) { final Set<String> selectedPaths = new HashSet<>(); final Collection<? extends AbstractFilePatchInProgress<?>> values = patchGroups.values(); for (AbstractFilePatchInProgress value : values) { final String path = value.getPatch()....
pathsFromGroups
261,219
void () { final NamedLegendStatuses includedNameStatuses = new NamedLegendStatuses(); final Collection<AbstractFilePatchInProgress.PatchChange> includedChanges = myChangesTreeList.getIncludedChanges(); final Set<Couple<String>> set = new HashSet<>(); for (AbstractFilePatchInProgress.PatchChange change : includedChanges...
run
261,220
void (@NotNull DocumentEvent e) { setPathFileChangeDefault(); queueRequest(); }
textChanged
261,221
void (final @Nullable @NlsContexts.DialogMessage String errorMessage) { setOKActionEnabled(errorMessage == null && isChangeTreeEnabled()); setErrorText(errorMessage, myChangeListChooser); }
accept
261,222
void () { super.update(); final int inapplicable = myInfoCalculator.getInapplicable(); if (inapplicable > 0) { appendSpace(); append(inapplicable, FileStatus.MERGED_WITH_CONFLICTS, VcsBundle.message("patch.apply.missing.base.file.label")); } }
update
261,223
void (@NotNull List<? extends @NotNull VFileEvent> events) { for (VFileEvent event : events) { if (event instanceof VFileContentChangeEvent) { syncUpdatePatchFileAndScheduleReloadIfNeeded(event.getFile()); } } }
after
261,224
void () { boolean changeTreeEnabled = isChangeTreeEnabled(); setOKActionEnabled(changeTreeEnabled); if (changeTreeEnabled) { if (myChangeListChooser != null) myChangeListChooser.updateEnabled(); } }
updateOkActions
261,225
boolean () { return !myChangesTreeList.getIncludedChanges().isEmpty(); }
isChangeTreeEnabled
261,226
void () { paintBusy(true); myLoadQueue.queue(myUpdater); }
queueRequest
261,227
void (@NotNull List<? extends FilePatch> patches) { List<AbstractFilePatchInProgress<?>> matchedPatches = new MatchPatchPaths(myProject).execute(patches, myUseProjectRootAsPredefinedBase); //todo add shelved binary patches ApplicationManager.getApplication().invokeLater(() -> { myPatches.clear(); myPatches.addAll(match...
init
261,228
FileChooserDescriptor () { return new FileChooserDescriptor(true, false, false, false, false, false) { @Override public boolean isFileSelectable(@Nullable VirtualFile file) { return file != null && (FileTypeRegistry.getInstance().isFileOfType(file, PatchFileType.INSTANCE) || FileTypeRegistry.getInstance().isFileOfType(...
createSelectPatchDescriptor
261,229
boolean (@Nullable VirtualFile file) { return file != null && (FileTypeRegistry.getInstance().isFileOfType(file, PatchFileType.INSTANCE) || FileTypeRegistry.getInstance().isFileOfType(file, FileTypes.PLAIN_TEXT)); }
isFileSelectable
261,230
void (ActionEvent e) { runExecutor(executor); close(NEXT_USER_EXIT_CODE + finalI); }
actionPerformed
261,231
void (ApplyPatchExecutor<AbstractFilePatchInProgress<?>> executor) { Collection<AbstractFilePatchInProgress<?>> included = getIncluded(); if (included.isEmpty()) { return; } MultiMap<VirtualFile, AbstractFilePatchInProgress<?>> patchGroups = new MultiMap<>(); for (AbstractFilePatchInProgress<?> patchInProgress : includ...
runExecutor
261,232
List<FilePatch> () { Collection<AbstractFilePatchInProgress> notIncluded = ContainerUtil.subtract(myPatches, getIncluded()); List<FilePatch> remainingOriginal = new ArrayList<>(); for (AbstractFilePatchInProgress progress : notIncluded) { progress.reset(); remainingOriginal.add(progress.getPatch()); } return remainingO...
getOriginalRemaining
261,233
String () { return DIMENSION_SERVICE_KEY; }
getDimensionServiceKey
261,234
String () { return myHelpId; }
getHelpId
261,235
JComponent () { if (myChangeListChooser != null) return myChangeListChooser.getPreferredFocusedComponent(); return myChangesTreeList; }
getPreferredFocusedComponent
261,236
void () { myRecentPathFileChange.set(new FilePresentationModel(myPatchFile.getText())); }
setPathFileChangeDefault
261,237
void (@NotNull final VirtualFile patchFile) { myPatchFile.setText(patchFile.getPresentableUrl()); myRecentPathFileChange.set(new FilePresentationModel(patchFile)); }
init
261,238
void (String s) { myHelpId = s; }
setHelpId
261,239
void () { cleanNotifications(); final FilePresentationModel filePresentationModel = myRecentPathFileChange.get(); final VirtualFile file = filePresentationModel != null ? filePresentationModel.getVf() : null; if (file == null) { ApplicationManager.getApplication().invokeLater(myReset, ModalityState.stateForComponent(my...
run
261,240
String (@Nullable String message) { return isEmptyOrSpaces(message) ? null : ChangeListUtil.createNameForChangeList(myProject, message); }
getSubjectFromMessage
261,241
PatchReader (@NotNull VirtualFile patchFile) { try { String text = ReadAction.compute(() -> { try (InputStreamReader inputStreamReader = new InputStreamReader(patchFile.getInputStream(), patchFile.getCharset())) { return StreamUtil.readText(inputStreamReader); } }); PatchReader reader = new PatchReader(text); reader.pa...
loadPatches
261,242
void (@NotNull @NlsContexts.Label String errorMessage) { LOG.warn(errorMessage); myErrorNotificationPanel.setText(errorMessage); myErrorNotificationPanel.setVisible(true); }
addNotificationAndWarn
261,243
void () { myErrorNotificationPanel.setText(""); myErrorNotificationPanel.setVisible(false); }
cleanNotifications
261,244
void (@Nullable VirtualFile eventFile) { // if dialog is modal and refresh called not from dispatch thread then // fireEvents in RefreshQueueImpl will not be triggered because of wrong modality state inside those thread -> defaultMS == NON_MODAL final FilePresentationModel filePresentationModel = myRecentPathFileChange...
syncUpdatePatchFileAndScheduleReloadIfNeeded
261,245
VirtualFile () { if (myVf == null) { final VirtualFile file = VfsUtil.findFileByIoFile(new File(myPath), true); myVf = file != null && !file.isDirectory() ? file : null; } return myVf; }
getVf
261,246
void () { myPatches.clear(); myChangesTreeList.setChangesToDisplay(Collections.emptyList()); myChangesTreeList.repaint(); myContainBasedChanges = false; paintBusy(false); }
reset
261,247
JComponent () { if (myCenterPanel == null) { myCenterPanel = new JPanel(new GridBagLayout()); final GridBagConstraints centralGb = createConstraints(); myPatchFileLabel = new JLabel(VcsBundle.message("patch.apply.file.name.field")); myPatchFileLabel.setLabelFor(myPatchFile); myCenterPanel.add(myPatchFileLabel, centralG...
createCenterPanel
261,248
void (@NotNull AnActionEvent e) { syncUpdatePatchFileAndScheduleReloadIfNeeded(null); }
actionPerformed
261,249
GridBagConstraints () { return new GridBagConstraints(0, 0, 1, 1, 1, 0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, JBUI.insets(1), 0, 0); }
createConstraints
261,250
void (final boolean isBusy) { if (isBusy) { myChangesTreeList.setEmptyText(""); myChangesTreeLoadingPanel.startLoading(); } else { myChangesTreeList.setEmptyText(VcsBundle.message("commit.dialog.no.changes.detected.text")); myChangesTreeLoadingPanel.stopLoading(); } }
paintBusy
261,251
DefaultTreeModel (@NotNull List<? extends AbstractFilePatchInProgress.PatchChange> changes) { try (AccessToken ignore = SlowOperations.knownIssue("IDEA-317156, EA-830617")) { return TreeModelBuilder.buildFromChanges(myProject, getGrouping(), changes, myChangeNodeDecorator); } }
buildTreeModel
261,252
boolean (@NotNull ChangesBrowserNode<?> node) { boolean enabled = super.isInclusionEnabled(node); Object value = node.getUserObject(); if (value instanceof AbstractFilePatchInProgress.PatchChange) { enabled &= ((AbstractFilePatchInProgress.PatchChange)value).isValid(); } return enabled; }
isInclusionEnabled
261,253
boolean (@NotNull Collection<?> changes) { List<AbstractFilePatchInProgress.PatchChange> patchChanges = ContainerUtil.findAll(changes, AbstractFilePatchInProgress.PatchChange.class); if (patchChanges.size() == 1 && !patchChanges.get(0).isValid()) { return handleInvalidChangesAndToggle(); } else { return super.toggleCha...
toggleChanges
261,254
boolean () { new NewBaseSelector(false).run(); return super.toggleChanges(getOnlyValidChanges(getSelectedChanges())); }
handleInvalidChangesAndToggle
261,255
void (@NotNull AnActionEvent e) { final List<AbstractFilePatchInProgress.PatchChange> selectedChanges = myChangesTreeList.getSelectedChanges(); if ((selectedChanges.size() >= 1) && (sameBase(selectedChanges))) { final AbstractFilePatchInProgress.PatchChange patchChange = selectedChanges.get(0); final AbstractFilePatchI...
actionPerformed
261,256
ActionUpdateThread () { return ActionUpdateThread.EDT; }
getActionUpdateThread
261,257
void (@NotNull AnActionEvent e) { final List<AbstractFilePatchInProgress.PatchChange> selectedChanges = myChangesTreeList.getSelectedChanges(); e.getPresentation().setEnabled((selectedChanges.size() >= 1) && (sameBase(selectedChanges))); }
update
261,258
boolean (final List<? extends AbstractFilePatchInProgress.PatchChange> selectedChanges) { VirtualFile base = null; for (AbstractFilePatchInProgress.PatchChange change : selectedChanges) { final VirtualFile changeBase = change.getPatchInProgress().getBase(); if (base == null) { base = changeBase; } else if (!base.equals...
sameBase
261,259
void (boolean doInitCheck) { final List<AbstractFilePatchInProgress> patchesToSelect = changes2patches(myChangesTreeList.getSelectedChanges()); final List<AbstractFilePatchInProgress.PatchChange> changes = getAllChanges(); final Collection<AbstractFilePatchInProgress.PatchChange> included = getIncluded(doInitCheck, cha...
updateTree
261,260
void (final NamedLegendStatuses nameStatuses, final AbstractFilePatchInProgress.PatchChange change) { final AbstractFilePatchInProgress patchInProgress = change.getPatchInProgress(); if (FilePatchStatus.ADDED.equals(patchInProgress.getStatus())) { nameStatuses.plusAdded(); } else if (FilePatchStatus.DELETED.equals(patc...
acceptChange
261,261
void () { final FileChooserDescriptor descriptor = myDirectorySelector ? FileChooserDescriptorFactory.createSingleFolderDescriptor() : FileChooserDescriptorFactory.createSingleFileNoJarsDescriptor(); descriptor.setTitle(VcsBundle.message("patch.apply.select.base.title", myDirectorySelector ? 0 : 1)); VirtualFile select...
run
261,262
List<AbstractFilePatchInProgress> (final List<? extends AbstractFilePatchInProgress.PatchChange> selectedChanges) { return map(selectedChanges, AbstractFilePatchInProgress.PatchChange::getPatchInProgress); }
changes2patches
261,263
boolean () { return true; }
isSpeedSearchEnabled
261,264
String (VirtualFile value) { return value == null ? VcsBundle.message("patch.apply.select.base.for.a.path.message") : value.getPath(); //NON-NLS }
getTextFor
261,265
void () { ++myAdded; }
plusAdded
261,266
void () { ++myModified; }
plusModified
261,267
void () { ++myDeleted; }
plusDeleted
261,268
void () { ++myInapplicable; }
plusInapplicable
261,269
int () { return myAdded; }
getAdded
261,270
int () { return myModified; }
getModified
261,271
int () { return myDeleted; }
getDeleted
261,272
int () { return myInapplicable; }
getInapplicable
261,273
void (final NamedLegendStatuses nameStatuses) { myTotal = nameStatuses; }
setTotal
261,274
void (final NamedLegendStatuses nameStatuses) { myIncluded = nameStatuses; }
setIncluded
261,275
int () { return myTotal.getAdded(); }
getNew
261,276
int () { return myTotal.getModified(); }
getModified
261,277
int () { return myTotal.getDeleted(); }
getDeleted
261,278
int () { return 0; }
getUnversioned
261,279
int () { return myTotal.getInapplicable(); }
getInapplicable
261,280
int () { return myIncluded.getAdded(); }
getIncludedNew
261,281
int () { return myIncluded.getModified(); }
getIncludedModified
261,282
int () { return myIncluded.getDeleted(); }
getIncludedDeleted
261,283
int () { return 0; }
getIncludedUnversioned
261,284
void (@NotNull Change change, @NotNull SimpleColoredComponent component, boolean isShowFlatten) { if (change instanceof AbstractFilePatchInProgress.PatchChange patchChange) { final AbstractFilePatchInProgress patchInProgress = patchChange.getPatchInProgress(); if (patchInProgress.getCurrentStrip() > 0) { component.appe...
decorate
261,285
void (@NotNull Change change, @NotNull ChangesBrowserNodeRenderer renderer, boolean showFlatten) { }
preDecorate
261,286
boolean (@NotNull AbstractFilePatchInProgress patchInProgress) { return !FileUtil .filesEqual(patchInProgress.myIoCurrentBase, new File(myProject.getBasePath(), patchInProgress.getOriginalBeforePath())); }
basePathWasChanged
261,287
LocalChangeList () { return myChangeListChooser != null ? myChangeListChooser.getSelectedList(myProject) : null; }
getSelectedChangeList
261,288
void () { super.doOKAction(); runExecutor(myCallback); }
doOKAction
261,289
void (@NotNull AnActionEvent e) { myChangesTreeList.getSelectedChanges().forEach(change -> change.getPatchInProgress().setZero()); updateTree(false); }
actionPerformed
261,290
ActionUpdateThread () { return ActionUpdateThread.EDT; }
getActionUpdateThread
261,291
void (@NotNull AnActionEvent e) { boolean isEnabled = ContainerUtil.exists(myChangesTreeList.getSelectedChanges(), change -> change.getPatchInProgress().canDown()); e.getPresentation().setEnabled(isEnabled); }
update
261,292
void (@NotNull AnActionEvent e) { myChangesTreeList.getSelectedChanges().forEach(change -> change.getPatchInProgress().down()); updateTree(false); }
actionPerformed
261,293
ActionUpdateThread () { return ActionUpdateThread.EDT; }
getActionUpdateThread
261,294
void (@NotNull AnActionEvent e) { boolean isEnabled = ContainerUtil.exists(myChangesTreeList.getSelectedChanges(), change -> change.getPatchInProgress().canUp()); e.getPresentation().setEnabled(isEnabled); }
update
261,295
void (@NotNull AnActionEvent e) { myChangesTreeList.getSelectedChanges().forEach(change -> change.getPatchInProgress().up()); updateTree(false); }
actionPerformed
261,296
void (@NotNull AnActionEvent e) { myChangesTreeList.getSelectedChanges().forEach(change -> change.getPatchInProgress().reset()); updateTree(false); }
actionPerformed
261,297
ActionUpdateThread () { return ActionUpdateThread.EDT; }
getActionUpdateThread
261,298
void (@NotNull AnActionEvent e) { e.getPresentation().setEnabled((!myPatches.isEmpty()) && myContainBasedChanges); }
update
261,299
void (@NotNull AnActionEvent e) { showDiff(); }
actionPerformed