From 8e3d33bb9a19c49578552f6f9fdca2b38cf95605 Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Thu, 13 Jun 2019 02:59:47 +0300 Subject: [PATCH] Git cleanup: add wildcards to conform to API conventions GitOrigin-RevId: bbec921aea2c0e04240b7dbd222b68bcc4d6f8c5 --- .../branch/DvcsMultiRootBranchConfig.java | 4 +- .../intellij/dvcs/branch/DvcsTaskHandler.java | 6 +- .../openapi/vcs/CommittedChangesProvider.java | 2 +- .../vcs/VcsOutgoingChangesProvider.java | 2 +- .../ChangeListFilteringStrategy.java | 15 ++-- .../checkin/BeforeCheckinDialogHandler.java | 2 +- .../vcs/history/VcsAnnotationCachedProxy.java | 2 +- .../VcsCacheableHistorySessionFactory.java | 2 +- .../openapi/vcs/merge/MergeSessionEx.java | 8 +-- .../openapi/vcs/update/UpdatedFiles.java | 2 +- .../vcs/changes/VcsPreservingExecutor.java | 2 +- .../vcs/changes/VcsShelveChangesSaver.java | 2 +- .../openapi/vcs/changes/VcsShelveUtils.java | 4 +- ...howDiffFromLocalChangesActionProvider.java | 20 +++--- .../lst/SimpleLocalChangeListDiffViewer.java | 16 ++--- .../committed/ColumnFilteringStrategy.java | 8 +-- .../committed/CommittedChangesPanel.java | 8 +-- .../CommittedChangesTreeBrowser.java | 6 +- .../CommittedListsSequencesZipper.java | 10 +-- .../CompositeChangeListFilteringStrategy.java | 12 ++-- .../CompositeCommittedChangesProvider.java | 2 +- .../changes/committed/RootsCalculator.java | 2 +- .../committed/StructureFilteringStrategy.java | 8 +-- .../patch/ApplyPatchDefaultExecutor.java | 2 +- .../vcs/changes/patch/ApplyPatchExecutor.java | 2 +- .../changes/patch/ImportToShelfExecutor.java | 2 +- .../patch/UnshelvePatchDefaultExecutor.java | 2 +- .../changes/shelf/ShelfFileProcessorUtil.java | 2 +- .../shelf/ShelvedChangesViewManager.java | 6 +- .../vcs/impl/LocalChangesUnderRoots.java | 10 +-- .../vcs/impl/ProjectLevelVcsManagerImpl.java | 2 +- .../vcs/impl/projectlevelman/NewMappings.java | 8 +-- .../vcs/roots/VcsRootDetectorImpl.java | 2 +- .../openapi/vcs/ui/FlatSpeedSearchPopup.java | 2 +- .../update/AbstractCommonUpdateAction.java | 2 +- .../openapi/vcs/update/UpdateInfoTree.java | 4 +- .../vcs/log/ui/filter/BranchPopupBuilder.java | 6 +- .../MockCommittedChangesProvider.java | 2 +- .../CvsCommittedChangesProvider.java | 2 +- .../git4idea/src/git4idea/GitTaskHandler.java | 6 +- plugins/git4idea/src/git4idea/GitUtil.java | 2 +- .../src/git4idea/actions/BasicAction.java | 2 +- .../git4idea/src/git4idea/actions/GitAdd.java | 6 +- .../src/git4idea/actions/GitMergeAction.java | 2 +- .../git4idea/actions/GitRepositoryAction.java | 2 +- .../git4idea/branch/DeepCompareAction.java | 6 +- .../GitBranchIncomingOutgoingManager.java | 2 +- .../git4idea/branch/GitBranchOperation.java | 9 +-- .../git4idea/branch/GitBranchUiHandler.java | 4 +- .../branch/GitBranchUiHandlerImpl.java | 4 +- .../src/git4idea/branch/GitBranchUtil.java | 4 +- .../src/git4idea/branch/GitBranchWorker.java | 24 +++---- .../src/git4idea/branch/GitBrancher.java | 50 ++++++-------- .../src/git4idea/branch/GitBrancherImpl.java | 26 +++---- .../branch/GitCheckoutNewBranchOperation.java | 2 +- .../git4idea/branch/GitCheckoutOperation.java | 6 +- .../branch/GitDeleteBranchOperation.java | 4 +- .../GitDeleteRemoteBranchOperation.java | 6 +- .../branch/GitDeleteTagOperation.java | 2 +- .../git4idea/branch/GitMergeOperation.java | 8 +-- .../branch/GitRenameBranchOperation.java | 2 +- .../branch/GitSmartOperationDialog.java | 2 +- .../branch/ShowDiffWithBranchDialog.kt | 2 +- .../src/git4idea/changes/GitChangeUtils.java | 18 ++--- .../GitCommittedChangeListProvider.java | 5 +- .../changes/GitOutgoingChangesProvider.java | 2 +- .../checkin/GitCheckinEnvironment.java | 6 +- .../checkin/GitCheckinHandlerFactory.java | 4 +- .../git4idea/src/git4idea/commands/Git.java | 10 +-- .../src/git4idea/commands/GitHandler.java | 8 +-- .../commands/GitHttpGuiAuthenticator.java | 2 +- .../src/git4idea/commands/GitImpl.java | 14 ++-- .../src/git4idea/commands/GitImplBase.java | 6 +- .../git4idea/conflicts/GitMergeHandler.java | 6 +- .../crlf/GitCrlfProblemsDetector.java | 4 +- .../git4idea/history/GitChangesParser.java | 5 +- .../history/GitDiffFromHistoryHandler.java | 12 ++-- .../src/git4idea/history/GitFileHistory.java | 16 ++--- .../git4idea/history/GitHistoryProvider.java | 2 +- .../git4idea/history/GitLogFullRecord.java | 6 +- .../history/GitLogRecordCollector.java | 6 +- .../GitLogUnorderedRecordCollector.java | 2 +- .../src/git4idea/index/GitIndexUtil.java | 4 +- .../src/git4idea/log/GitLogDiffHandler.java | 8 +-- .../log/GitShowExternalLogAction.java | 4 +- .../git4idea/merge/GitConflictResolver.java | 10 +-- .../GitMergeCommittingConflictResolver.java | 4 +- .../src/git4idea/merge/GitMergeProvider.java | 6 +- .../src/git4idea/merge/GitMergeUtil.java | 4 +- .../src/git4idea/merge/GitMerger.java | 2 +- .../git4idea/merge/MergeChangeCollector.java | 4 +- .../src/git4idea/push/GitPushOperation.java | 10 +-- .../rebase/GitAbortRebaseProcess.java | 2 +- .../rebase/GitInteractiveRebaseFile.java | 2 +- .../src/git4idea/rebase/GitRebaseProcess.java | 8 +-- .../src/git4idea/rebase/GitRebaseSpec.java | 6 +- .../src/git4idea/rebase/GitRebaseUtils.java | 4 +- .../src/git4idea/rebase/GitRebaser.java | 2 +- .../git4idea/src/git4idea/repo/GitConfig.java | 22 +++--- .../src/git4idea/repo/GitConflictsHolder.java | 2 +- .../git4idea/repo/GitRepositoryManager.java | 2 +- .../git4idea/repo/GitRepositoryReader.java | 2 +- .../repo/GitUntrackedFilesHolder.java | 2 +- .../src/git4idea/reset/GitResetOperation.java | 2 +- .../rollback/GitRollbackEnvironment.java | 6 +- .../src/git4idea/stash/GitChangesSaver.java | 4 +- .../git4idea/stash/GitShelveChangesSaver.java | 2 +- .../git4idea/stash/GitStashChangesSaver.java | 6 +- .../git4idea/status/GitChangeProvider.java | 2 +- .../git4idea/status/GitChangesCollector.java | 6 +- .../ui/ChangesBrowserWithRollback.java | 2 +- .../ui/branch/GitBranchPopupActions.java | 69 ++++++++++--------- .../GitLogBranchOperationsActionGroup.java | 6 +- .../ui/branch/GitMultiRootBranchConfig.java | 2 +- .../src/git4idea/ui/branch/GitRefDialog.java | 18 ++--- .../src/git4idea/update/GitFetcher.java | 2 +- .../src/git4idea/util/GitFileUtils.java | 10 +-- .../git4idea/util/GitPreservingExecutor.java | 5 +- .../git4idea/util/GitPreservingProcess.java | 4 +- .../util/GitUntrackedFilesHelper.java | 2 +- .../LocalChangesWouldBeOverwrittenHelper.java | 2 +- .../validators/GitNewBranchNameValidator.java | 6 +- .../src/git4idea/vfs/GitVFSListener.java | 16 ++--- .../git4idea/log/GitBranchComparatorTest.java | 4 +- .../git4idea/log/GitLabelComparatorTest.java | 4 +- .../tests/git4idea/log/GitRefGroupsTest.java | 2 +- .../tests/git4idea/log/GitRefManagerTest.java | 2 +- .../repo/GitRepositoryReaderTest.java | 2 +- .../tests/git4idea/test/GitScenarios.java | 4 +- .../src/org/zmlx/hg4idea/HgTaskHandler.java | 6 +- .../provider/HgCommittedChangesProvider.java | 2 +- .../idea/svn/history/RootsAndBranches.java | 9 +-- .../history/SvnCommittedChangesProvider.java | 2 +- .../idea/svn/history/SvnHistoryProvider.java | 2 +- .../idea/svn/history/SvnHistorySession.java | 2 +- .../ApplyPatchSaveToFileExecutor.java | 2 +- .../treeConflict/MergeFromTheirsResolver.java | 2 +- 137 files changed, 420 insertions(+), 425 deletions(-) diff --git a/platform/dvcs-impl/src/com/intellij/dvcs/branch/DvcsMultiRootBranchConfig.java b/platform/dvcs-impl/src/com/intellij/dvcs/branch/DvcsMultiRootBranchConfig.java index bc9e2f4a7e15..38203a3b0a1f 100644 --- a/platform/dvcs-impl/src/com/intellij/dvcs/branch/DvcsMultiRootBranchConfig.java +++ b/platform/dvcs-impl/src/com/intellij/dvcs/branch/DvcsMultiRootBranchConfig.java @@ -23,9 +23,9 @@ import org.jetbrains.annotations.Nullable; import java.util.Collection; public abstract class DvcsMultiRootBranchConfig { - @NotNull protected final Collection myRepositories; + @NotNull protected final Collection myRepositories; - public DvcsMultiRootBranchConfig(@NotNull Collection repositories) { + public DvcsMultiRootBranchConfig(@NotNull Collection repositories) { myRepositories = repositories; } diff --git a/platform/dvcs-impl/src/com/intellij/dvcs/branch/DvcsTaskHandler.java b/platform/dvcs-impl/src/com/intellij/dvcs/branch/DvcsTaskHandler.java index 94c330d572f9..d62f96452562 100644 --- a/platform/dvcs-impl/src/com/intellij/dvcs/branch/DvcsTaskHandler.java +++ b/platform/dvcs-impl/src/com/intellij/dvcs/branch/DvcsTaskHandler.java @@ -147,9 +147,9 @@ public abstract class DvcsTaskHandler extends VcsTaskHandl return ContainerUtil.mapNotNull(urls, (NullableFunction)s -> ContainerUtil.find(repositories, repository -> s.equals(repository.getPresentableUrl()))); } - protected abstract void checkout(@NotNull String taskName, @NotNull List repos, @Nullable Runnable callInAwtLater); + protected abstract void checkout(@NotNull String taskName, @NotNull List repos, @Nullable Runnable callInAwtLater); - protected abstract void checkoutAsNewBranch(@NotNull String name, @NotNull List repositories); + protected abstract void checkoutAsNewBranch(@NotNull String name, @NotNull List repositories); @Nullable protected abstract String getActiveBranch(R repository); @@ -157,7 +157,7 @@ public abstract class DvcsTaskHandler extends VcsTaskHandl @NotNull protected abstract Iterable getAllBranches(@NotNull R repository); - protected abstract void mergeAndClose(@NotNull String branch, @NotNull List repositories); + protected abstract void mergeAndClose(@NotNull String branch, @NotNull List repositories); protected abstract boolean hasBranch(@NotNull R repository, @NotNull TaskInfo name); } diff --git a/platform/vcs-api/src/com/intellij/openapi/vcs/CommittedChangesProvider.java b/platform/vcs-api/src/com/intellij/openapi/vcs/CommittedChangesProvider.java index ae55b810673c..e98a18f1a8af 100644 --- a/platform/vcs-api/src/com/intellij/openapi/vcs/CommittedChangesProvider.java +++ b/platform/vcs-api/src/com/intellij/openapi/vcs/CommittedChangesProvider.java @@ -43,7 +43,7 @@ public interface CommittedChangesProvider getCommittedChanges(U settings, RepositoryLocation location, final int maxCount) throws VcsException; - void loadCommittedChanges(U settings, RepositoryLocation location, final int maxCount, final AsynchConsumer consumer) throws VcsException; + void loadCommittedChanges(U settings, RepositoryLocation location, final int maxCount, final AsynchConsumer consumer) throws VcsException; ChangeListColumn[] getColumns(); diff --git a/platform/vcs-api/src/com/intellij/openapi/vcs/VcsOutgoingChangesProvider.java b/platform/vcs-api/src/com/intellij/openapi/vcs/VcsOutgoingChangesProvider.java index f56cdfb7ed3f..be19eaafb4cd 100644 --- a/platform/vcs-api/src/com/intellij/openapi/vcs/VcsOutgoingChangesProvider.java +++ b/platform/vcs-api/src/com/intellij/openapi/vcs/VcsOutgoingChangesProvider.java @@ -30,7 +30,7 @@ public interface VcsOutgoingChangesProvider exte Pair> getOutgoingChanges(final VirtualFile vcsRoot, final boolean findRemote) throws VcsException; @Nullable VcsRevisionNumber getMergeBaseNumber(final VirtualFile anyFileUnderRoot) throws VcsException; - Collection filterLocalChangesBasedOnLocalCommits(final Collection localChanges, final VirtualFile vcsRoot) throws VcsException; + Collection filterLocalChangesBasedOnLocalCommits(final Collection localChanges, final VirtualFile vcsRoot) throws VcsException; @Nullable Date getRevisionDate(final VcsRevisionNumber revision, FilePath file); } diff --git a/platform/vcs-api/src/com/intellij/openapi/vcs/changes/committed/ChangeListFilteringStrategy.java b/platform/vcs-api/src/com/intellij/openapi/vcs/changes/committed/ChangeListFilteringStrategy.java index 14f15454d4ce..c2659818cd23 100644 --- a/platform/vcs-api/src/com/intellij/openapi/vcs/changes/committed/ChangeListFilteringStrategy.java +++ b/platform/vcs-api/src/com/intellij/openapi/vcs/changes/committed/ChangeListFilteringStrategy.java @@ -16,6 +16,7 @@ package com.intellij.openapi.vcs.changes.committed; import com.intellij.openapi.vcs.versionBrowser.CommittedChangeList; +import com.intellij.util.containers.ContainerUtil; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -29,17 +30,17 @@ import java.util.List; public interface ChangeListFilteringStrategy { @Nullable JComponent getFilterUI(); - void setFilterBase(List changeLists); + void setFilterBase(List changeLists); void addChangeListener(ChangeListener listener); void removeChangeListener(ChangeListener listener); CommittedChangesFilterKey getKey(); @Nullable void resetFilterBase(); - void appendFilterBase(List changeLists); + void appendFilterBase(List changeLists); @NotNull - List filterChangeLists(List changeLists); + List filterChangeLists(List changeLists); ChangeListFilteringStrategy NONE = new ChangeListFilteringStrategy() { private final CommittedChangesFilterKey myKey = new CommittedChangesFilterKey("None", CommittedChangesFilterPriority.NONE); @@ -55,7 +56,7 @@ public interface ChangeListFilteringStrategy { } @Override - public void setFilterBase(List changeLists) { + public void setFilterBase(List changeLists) { } @Override @@ -72,13 +73,13 @@ public interface ChangeListFilteringStrategy { } @Override - public void appendFilterBase(List changeLists) { + public void appendFilterBase(List changeLists) { } @Override @NotNull - public List filterChangeLists(List changeLists) { - return changeLists; + public List filterChangeLists(List changeLists) { + return ContainerUtil.immutableList(changeLists); } @Override diff --git a/platform/vcs-api/src/com/intellij/openapi/vcs/checkin/BeforeCheckinDialogHandler.java b/platform/vcs-api/src/com/intellij/openapi/vcs/checkin/BeforeCheckinDialogHandler.java index cc151ebef06d..ce47605a1ffb 100644 --- a/platform/vcs-api/src/com/intellij/openapi/vcs/checkin/BeforeCheckinDialogHandler.java +++ b/platform/vcs-api/src/com/intellij/openapi/vcs/checkin/BeforeCheckinDialogHandler.java @@ -28,7 +28,7 @@ public abstract class BeforeCheckinDialogHandler { * @return false to cancel commit */ @Deprecated - public boolean beforeCommitDialogShownCallback(Iterable executors, boolean showVcsCommit) { + public boolean beforeCommitDialogShownCallback(Iterable executors, boolean showVcsCommit) { throw new AbstractMethodError(); } diff --git a/platform/vcs-api/src/com/intellij/openapi/vcs/history/VcsAnnotationCachedProxy.java b/platform/vcs-api/src/com/intellij/openapi/vcs/history/VcsAnnotationCachedProxy.java index 84d3f47e30a8..4ac7bff74f6b 100644 --- a/platform/vcs-api/src/com/intellij/openapi/vcs/history/VcsAnnotationCachedProxy.java +++ b/platform/vcs-api/src/com/intellij/openapi/vcs/history/VcsAnnotationCachedProxy.java @@ -83,7 +83,7 @@ public class VcsAnnotationCachedProxy implements AnnotationProvider { * @param currentRevision - just a hint for optimization */ private FileAnnotation annotate(VirtualFile file, final VcsRevisionNumber revisionNumber, final boolean currentRevision, - final ThrowableComputable delegate) throws VcsException { + final ThrowableComputable delegate) throws VcsException { final FilePath filePath = VcsUtil.getFilePath(file); diff --git a/platform/vcs-api/src/com/intellij/openapi/vcs/history/VcsCacheableHistorySessionFactory.java b/platform/vcs-api/src/com/intellij/openapi/vcs/history/VcsCacheableHistorySessionFactory.java index 4eacc0b2229d..ccdd135fd45a 100644 --- a/platform/vcs-api/src/com/intellij/openapi/vcs/history/VcsCacheableHistorySessionFactory.java +++ b/platform/vcs-api/src/com/intellij/openapi/vcs/history/VcsCacheableHistorySessionFactory.java @@ -28,7 +28,7 @@ import java.util.List; public interface VcsCacheableHistorySessionFactory { T createFromCachedData(@Nullable Cacheable cacheable, - @NotNull List revisions, + @NotNull List revisions, @NotNull FilePath filePath, @Nullable VcsRevisionNumber currentRevision); diff --git a/platform/vcs-api/src/com/intellij/openapi/vcs/merge/MergeSessionEx.java b/platform/vcs-api/src/com/intellij/openapi/vcs/merge/MergeSessionEx.java index 8d024705fb6d..d1208d4b0f27 100644 --- a/platform/vcs-api/src/com/intellij/openapi/vcs/merge/MergeSessionEx.java +++ b/platform/vcs-api/src/com/intellij/openapi/vcs/merge/MergeSessionEx.java @@ -17,16 +17,16 @@ public interface MergeSessionEx extends MergeSession { /** * Called when user executes "Accept Theirs" or "Accept Ours" action to update file content on disk to the selected version. * + * @param files * @param resolution AcceptedYours or AcceptedTheirs */ - void acceptFilesRevisions(@NotNull List files, @NotNull MergeSessionEx.Resolution resolution) throws VcsException; + void acceptFilesRevisions(@NotNull List files, @NotNull Resolution resolution) throws VcsException; /** * Called after conflict resolution for conflicting files. * @see #conflictResolvedForFile - * - * @param files the conflicting file. + *@param files the conflicting file. * @param resolution the used resolution. */ - void conflictResolvedForFiles(@NotNull List files, @NotNull Resolution resolution); + void conflictResolvedForFiles(@NotNull List files, @NotNull Resolution resolution); } diff --git a/platform/vcs-api/src/com/intellij/openapi/vcs/update/UpdatedFiles.java b/platform/vcs-api/src/com/intellij/openapi/vcs/update/UpdatedFiles.java index 8174953541ab..0ab9e04a1965 100644 --- a/platform/vcs-api/src/com/intellij/openapi/vcs/update/UpdatedFiles.java +++ b/platform/vcs-api/src/com/intellij/openapi/vcs/update/UpdatedFiles.java @@ -53,7 +53,7 @@ public class UpdatedFiles implements JDOMExternalizable { return findByIdIn(myGroups, id); } - private static FileGroup findByIdIn(List groups, String id) { + private static FileGroup findByIdIn(List groups, String id) { for (FileGroup fileGroup : groups) { if (id.equals(fileGroup.getId())) return fileGroup; FileGroup foundInChildren = findByIdIn(fileGroup.getChildren(), id); diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/VcsPreservingExecutor.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/VcsPreservingExecutor.java index 922ff3e2c048..5e495089d767 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/VcsPreservingExecutor.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/VcsPreservingExecutor.java @@ -19,7 +19,7 @@ public interface VcsPreservingExecutor { * @return true if the executor supports provided roots or false otherwise. */ boolean execute(@NotNull Project project, - @NotNull Collection rootsToSave, + @NotNull Collection rootsToSave, @NotNull String operationTitle, @NotNull ProgressIndicator indicator, @NotNull Runnable operation); diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/VcsShelveChangesSaver.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/VcsShelveChangesSaver.java index 5c232ef23717..a230d61509fa 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/VcsShelveChangesSaver.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/VcsShelveChangesSaver.java @@ -46,7 +46,7 @@ public class VcsShelveChangesSaver { return myShelvedLists; } - public void save(@NotNull Collection rootsToSave) throws VcsException { + public void save(@NotNull Collection rootsToSave) throws VcsException { LOG.info("save " + rootsToSave); final Map>> lists = new LocalChangesUnderRoots(myChangeManager, myVcsManager).getChangesByLists(rootsToSave); diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/VcsShelveUtils.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/VcsShelveUtils.java index 4ebc21b28992..9a97f2607fa9 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/VcsShelveUtils.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/VcsShelveUtils.java @@ -77,8 +77,8 @@ public class VcsShelveUtils { } private static void refreshFilesBeforeUnshelve(String projectPath, - @NotNull List shelvedChanges, - @NotNull List binaryFiles) { + @NotNull List shelvedChanges, + @NotNull List binaryFiles) { HashSet filesToRefresh = new HashSet<>(); shelvedChanges.forEach(c -> { if (c.getBeforePath() != null) { diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/diff/ShowDiffFromLocalChangesActionProvider.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/diff/ShowDiffFromLocalChangesActionProvider.java index 08b537c36d63..b901406bc1b9 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/diff/ShowDiffFromLocalChangesActionProvider.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/diff/ShowDiffFromLocalChangesActionProvider.java @@ -60,7 +60,7 @@ public class ShowDiffFromLocalChangesActionProvider implements AnActionExtension } } - private static boolean canShowDiff(@Nullable Project project, @NotNull Stream changes, @NotNull Stream files) { + private static boolean canShowDiff(@Nullable Project project, @NotNull Stream changes, @NotNull Stream files) { return files.findAny().isPresent() || changes.anyMatch(it -> ChangeDiffRequestProducer.canCreate(project, it)); } @@ -95,7 +95,7 @@ public class ShowDiffFromLocalChangesActionProvider implements AnActionExtension } - private static boolean checkIfThereAreFakeRevisions(@NotNull Project project, @NotNull List changes) { + private static boolean checkIfThereAreFakeRevisions(@NotNull Project project, @NotNull List changes) { boolean needsConversion = false; for (Change change : changes) { final ContentRevision beforeRevision = change.getBeforeRevision(); @@ -113,7 +113,7 @@ public class ShowDiffFromLocalChangesActionProvider implements AnActionExtension } @NotNull - private static List loadFakeRevisions(@NotNull Project project, @NotNull List changes) { + private static List loadFakeRevisions(@NotNull Project project, @NotNull List changes) { List actualChanges = new ArrayList<>(); for (Change change : changes) { actualChanges.addAll(ChangeListManager.getInstance(project).getChangesIn(ChangesUtil.getFilePath(change))); @@ -123,8 +123,8 @@ public class ShowDiffFromLocalChangesActionProvider implements AnActionExtension private static void showDiff(@NotNull Project project, - @NotNull List changes, - @NotNull List unversioned, + @NotNull List changes, + @NotNull List unversioned, @NotNull ChangesListView changesView) { if (changes.size() == 1 && unversioned.isEmpty()) { // show all changes from this changelist Change selectedChange = changes.get(0); @@ -153,7 +153,7 @@ public class ShowDiffFromLocalChangesActionProvider implements AnActionExtension private static void showChangesDiff(@Nullable Project project, - @NotNull ListSelection selection) { + @NotNull ListSelection selection) { ListSelection producers = selection.map(change -> ChangeDiffRequestProducer.create(project, change)); @@ -161,7 +161,7 @@ public class ShowDiffFromLocalChangesActionProvider implements AnActionExtension } private static void showUnversionedDiff(@Nullable Project project, - @NotNull ListSelection selection) { + @NotNull ListSelection selection) { ListSelection producers = selection.map(change -> UnversionedDiffRequestProducer.create(project, change)); @@ -169,8 +169,8 @@ public class ShowDiffFromLocalChangesActionProvider implements AnActionExtension } private static void showSelectionDiff(@Nullable Project project, - @NotNull List changes, - @NotNull List unversioned) { + @NotNull List changes, + @NotNull List unversioned) { List changeRequests = ContainerUtil.mapNotNull(changes, change -> ChangeDiffRequestProducer.create(project, change)); List unversionedRequests = @@ -180,7 +180,7 @@ public class ShowDiffFromLocalChangesActionProvider implements AnActionExtension } private static void showDiff(@Nullable Project project, - @NotNull List producers, + @NotNull List producers, int selected) { if (producers.isEmpty()) return; DiffRequestChain chain = new ChangeDiffRequestChain(producers, selected); diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/diff/lst/SimpleLocalChangeListDiffViewer.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/diff/lst/SimpleLocalChangeListDiffViewer.java index 6024c758cb57..66aa4abe340a 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/diff/lst/SimpleLocalChangeListDiffViewer.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/diff/lst/SimpleLocalChangeListDiffViewer.java @@ -341,7 +341,7 @@ public class SimpleLocalChangeListDiffViewer extends SimpleDiffViewer { @NotNull @Override - protected String getText(@NotNull List selectedChanges) { + protected String getText(@NotNull List selectedChanges) { if (!selectedChanges.isEmpty() && ContainerUtil.and(selectedChanges, change -> !change.isFromActiveChangelist())) { String shortChangeListName = StringUtil.trimMiddle(myChangelistName, 40); return String.format("Move to '%s' Changelist", StringUtil.escapeMnemonics(shortChangeListName)); @@ -354,7 +354,7 @@ public class SimpleLocalChangeListDiffViewer extends SimpleDiffViewer { @Override protected void doPerform(@NotNull AnActionEvent e, @NotNull PartialLocalLineStatusTracker tracker, - @NotNull List selectedChanges) { + @NotNull List selectedChanges) { BitSet selectedLines = getLocalSelectedLines(selectedChanges); if (ContainerUtil.and(selectedChanges, change -> !change.isFromActiveChangelist())) { @@ -377,7 +377,7 @@ public class SimpleLocalChangeListDiffViewer extends SimpleDiffViewer { @NotNull @Override - protected String getText(@NotNull List selectedChanges) { + protected String getText(@NotNull List selectedChanges) { boolean hasExcluded = ContainerUtil.or(selectedChanges, MySimpleDiffChange::isExcludedFromCommit); return selectedChanges.isEmpty() || !hasExcluded ? "Exclude Lines from Commit" : "Include Lines into Commit"; } @@ -385,7 +385,7 @@ public class SimpleLocalChangeListDiffViewer extends SimpleDiffViewer { @Override protected void doPerform(@NotNull AnActionEvent e, @NotNull PartialLocalLineStatusTracker tracker, - @NotNull List selectedChanges) { + @NotNull List selectedChanges) { BitSet selectedLines = getLocalSelectedLines(selectedChanges); boolean hasExcluded = ContainerUtil.or(selectedChanges, MySimpleDiffChange::isExcludedFromCommit); @@ -404,7 +404,7 @@ public class SimpleLocalChangeListDiffViewer extends SimpleDiffViewer { @Override protected void doPerform(@NotNull AnActionEvent e, @NotNull PartialLocalLineStatusTracker tracker, - @NotNull List selectedChanges) { + @NotNull List selectedChanges) { BitSet selectedLines = getLocalSelectedLines(selectedChanges); tracker.setExcludedFromCommit(true); @@ -477,18 +477,18 @@ public class SimpleLocalChangeListDiffViewer extends SimpleDiffViewer { } @NotNull - protected String getText(@NotNull List selectedChanges) { + protected String getText(@NotNull List selectedChanges) { return getTemplatePresentation().getText(); } @CalledWithWriteLock protected abstract void doPerform(@NotNull AnActionEvent e, @NotNull PartialLocalLineStatusTracker tracker, - @NotNull List selectedChanges); + @NotNull List selectedChanges); } @NotNull - private static BitSet getLocalSelectedLines(@NotNull List changes) { + private static BitSet getLocalSelectedLines(@NotNull List changes) { BitSet selectedLines = new BitSet(); for (SimpleDiffChange change : changes) { int startLine = change.getStartLine(Side.RIGHT); diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/ColumnFilteringStrategy.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/ColumnFilteringStrategy.java index c356e446c71a..3e22c80be606 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/ColumnFilteringStrategy.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/ColumnFilteringStrategy.java @@ -84,7 +84,7 @@ public class ColumnFilteringStrategy implements ChangeListFilteringStrategy { } @Override - public void setFilterBase(List changeLists) { + public void setFilterBase(List changeLists) { myPreferredSelection = null; appendFilterBase(changeLists); } @@ -109,7 +109,7 @@ public class ColumnFilteringStrategy implements ChangeListFilteringStrategy { } @Override - public void appendFilterBase(List changeLists) { + public void appendFilterBase(List changeLists) { final Object[] oldSelection = myModel.isEmpty() ? myPreferredSelection : myValueList.getSelectedValues(); myModel.addNext(changeLists, ourConvertorInstance); @@ -134,10 +134,10 @@ public class ColumnFilteringStrategy implements ChangeListFilteringStrategy { @Override @NotNull - public List filterChangeLists(List changeLists) { + public List filterChangeLists(List changeLists) { final Object[] selection = myValueList.getSelectedValues(); if (myValueList.getSelectedIndex() == 0 || selection.length == 0) { - return changeLists; + return ContainerUtil.immutableList(changeLists); } List result = new ArrayList<>(); for (CommittedChangeList changeList : changeLists) { diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/CommittedChangesPanel.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/CommittedChangesPanel.java index bacf399a0c5f..1db2dda36594 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/CommittedChangesPanel.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/CommittedChangesPanel.java @@ -262,7 +262,7 @@ public class CommittedChangesPanel extends JPanel implements TypeSafeDataProvide } } - private void updateFilteredModel(List committedChangeLists, final boolean reset) { + private void updateFilteredModel(List committedChangeLists, final boolean reset) { if (committedChangeLists == null) { return; } @@ -340,7 +340,7 @@ public class CommittedChangesPanel extends JPanel implements TypeSafeDataProvide return null; } @Override - public void setFilterBase(List changeLists) { + public void setFilterBase(List changeLists) { } @Override public void addChangeListener(ChangeListener listener) { @@ -354,11 +354,11 @@ public class CommittedChangesPanel extends JPanel implements TypeSafeDataProvide public void resetFilterBase() { } @Override - public void appendFilterBase(List changeLists) { + public void appendFilterBase(List changeLists) { } @Override @NotNull - public List filterChangeLists(List changeLists) { + public List filterChangeLists(List changeLists) { final FilterHelper filterHelper; setEmptyMessage(myChangesLoaded); if (myRegexCheckbox.isSelected()) { diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/CommittedChangesTreeBrowser.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/CommittedChangesTreeBrowser.java index bf60a8f48c7a..fe944fa34926 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/CommittedChangesTreeBrowser.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/CommittedChangesTreeBrowser.java @@ -92,7 +92,7 @@ public class CommittedChangesTreeBrowser extends JPanel implements TypeSafeDataP private final MessageBusConnection myConnection; private TreeState myState; - public CommittedChangesTreeBrowser(final Project project, final List changeLists) { + public CommittedChangesTreeBrowser(final Project project, final List changeLists) { super(new BorderLayout()); myProject = project; @@ -226,7 +226,7 @@ public class CommittedChangesTreeBrowser extends JPanel implements TypeSafeDataP mySplitterProportionsData.externalizeToDimensionService("CommittedChanges.SplitterProportions"); } - public void setItems(@NotNull List items, final CommittedChangesBrowserUseCase useCase) { + public void setItems(@NotNull List items, final CommittedChangesBrowserUseCase useCase) { myDetailsView.setUseCase(useCase); myChangeLists = new ArrayList<>(items); myFilteringStrategy.setFilterBase(items); @@ -487,7 +487,7 @@ public class CommittedChangesTreeBrowser extends JPanel implements TypeSafeDataP updateModel(); } - public void append(final List list) { + public void append(final List list) { final TreeState state = myChangeLists.isEmpty() && myState != null ? myState : TreeState.createOn(myChangesTree, (DefaultMutableTreeNode)myChangesTree.getModel().getRoot()); state.setScrollToSelection(false); diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/CommittedListsSequencesZipper.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/CommittedListsSequencesZipper.java index 3856b7c98b3c..77b996a194e7 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/CommittedListsSequencesZipper.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/CommittedListsSequencesZipper.java @@ -15,7 +15,7 @@ public class CommittedListsSequencesZipper { @NotNull private final VcsCommittedListsZipper myVcsPartner; @NotNull private final List myInLocations; - @NotNull private final Map> myInLists; + @NotNull private final Map> myInLists; @NotNull private final Comparator myComparator; public CommittedListsSequencesZipper(@NotNull VcsCommittedListsZipper vcsPartner) { @@ -25,7 +25,7 @@ public class CommittedListsSequencesZipper { myComparator = (o1, o2) -> Comparing.compare(myVcsPartner.getNumber(o1), myVcsPartner.getNumber(o2)); } - public void add(@NotNull RepositoryLocation location, @NotNull List lists) { + public void add(@NotNull RepositoryLocation location, @NotNull List lists) { myInLocations.add(location); Collections.sort(lists, myComparator); myInLists.put(location.toPresentableString(), lists); @@ -45,8 +45,8 @@ public class CommittedListsSequencesZipper { } @NotNull - private List> collectChangeLists(@NotNull List locations) { - List> result = new ArrayList<>(locations.size()); + private List> collectChangeLists(@NotNull List locations) { + List> result = new ArrayList<>(locations.size()); for (RepositoryLocation location : locations) { result.add(myInLists.get(location.toPresentableString())); @@ -77,7 +77,7 @@ public class CommittedListsSequencesZipper { } @NotNull - private CommittedChangeList zip(@NotNull RepositoryLocationGroup group, @NotNull List equalLists) { + private CommittedChangeList zip(@NotNull RepositoryLocationGroup group, @NotNull List equalLists) { if (equalLists.isEmpty()) { throw new IllegalArgumentException("equalLists can not be empty"); } diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/CompositeChangeListFilteringStrategy.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/CompositeChangeListFilteringStrategy.java index 8b08f25c2b06..b71fe415a6de 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/CompositeChangeListFilteringStrategy.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/CompositeChangeListFilteringStrategy.java @@ -30,17 +30,17 @@ public class CompositeChangeListFilteringStrategy implements ChangeListFiltering } @Override - public void setFilterBase(final List changeLists) { + public void setFilterBase(final List changeLists) { setFilterBaseImpl(changeLists, true); } - private List setFilterBaseImpl(final List changeLists, final boolean setFirst) { + private List setFilterBaseImpl(final List changeLists, final boolean setFirst) { + List list = new ArrayList<>(changeLists); if (myInSetBase) { - return changeLists; + return list; } myInSetBase = true; - List list = new ArrayList<>(changeLists); boolean callSetFilterBase = setFirst; for (final ChangeListFilteringStrategy delegate : myDelegates.values()) { if (callSetFilterBase) { @@ -77,7 +77,7 @@ public class CompositeChangeListFilteringStrategy implements ChangeListFiltering } @Override - public void appendFilterBase(final List changeLists) { + public void appendFilterBase(final List changeLists) { List list = new ArrayList<>(changeLists); for (final ChangeListFilteringStrategy delegate : myDelegates.values()) { delegate.appendFilterBase(list); @@ -87,7 +87,7 @@ public class CompositeChangeListFilteringStrategy implements ChangeListFiltering @Override @NotNull - public List filterChangeLists(final List changeLists) { + public List filterChangeLists(final List changeLists) { return setFilterBaseImpl(changeLists, false); } diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/CompositeCommittedChangesProvider.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/CompositeCommittedChangesProvider.java index c2f08a5318bf..b91854d9f831 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/CompositeCommittedChangesProvider.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/CompositeCommittedChangesProvider.java @@ -85,7 +85,7 @@ public class CompositeCommittedChangesProvider implements CommittedChangesProvid public void loadCommittedChanges(CompositeChangeBrowserSettings settings, RepositoryLocation location, int maxCount, - AsynchConsumer consumer) { + AsynchConsumer consumer) { throw new UnsupportedOperationException(); } diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/RootsCalculator.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/RootsCalculator.java index 27e1664e6a77..a6859932c387 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/RootsCalculator.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/RootsCalculator.java @@ -89,7 +89,7 @@ public class RootsCalculator { return myLocationCache.getLocation(myVcs, getFilePath(file), false); } - private static void logRoots(@NotNull String prefix, @NotNull Collection roots) { + private static void logRoots(@NotNull String prefix, @NotNull Collection roots) { if (LOG.isDebugEnabled()) { LOG.debug(prefix + ": " + join(roots, VirtualFile::getPath, ", ")); } diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/StructureFilteringStrategy.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/StructureFilteringStrategy.java index db15d7dce067..c80983c5d770 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/StructureFilteringStrategy.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/StructureFilteringStrategy.java @@ -64,7 +64,7 @@ public class StructureFilteringStrategy implements ChangeListFilteringStrategy { } @Override - public void setFilterBase(List changeLists) { + public void setFilterBase(List changeLists) { // todo cycle here if (myUI == null) { myUI = new MyUI(); @@ -89,15 +89,15 @@ public class StructureFilteringStrategy implements ChangeListFilteringStrategy { } @Override - public void appendFilterBase(List changeLists) { + public void appendFilterBase(List changeLists) { myUI.append(changeLists); } @Override @NotNull - public List filterChangeLists(List changeLists) { + public List filterChangeLists(List changeLists) { if (mySelection.size() == 0) { - return changeLists; + return ContainerUtil.immutableList(changeLists); } final ArrayList result = new ArrayList<>(); for (CommittedChangeList list : changeLists) { diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/patch/ApplyPatchDefaultExecutor.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/patch/ApplyPatchDefaultExecutor.java index 0b4374517633..1f232d942fcf 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/patch/ApplyPatchDefaultExecutor.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/patch/ApplyPatchDefaultExecutor.java @@ -39,7 +39,7 @@ public class ApplyPatchDefaultExecutor implements ApplyPatchExecutor remaining, @NotNull MultiMap patchGroupsToApply, @Nullable LocalChangeList localList, @Nullable String fileName, - @Nullable ThrowableComputable>, PatchSyntaxException> additionalInfo) { + @Nullable ThrowableComputable>, PatchSyntaxException> additionalInfo) { final CommitContext commitContext = new CommitContext(); applyAdditionalInfoBefore(myProject, additionalInfo, commitContext); final Collection appliers = getPatchAppliers(patchGroupsToApply, localList, commitContext); diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/patch/ApplyPatchExecutor.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/patch/ApplyPatchExecutor.java index 646a898fd949..cd23edf85cef 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/patch/ApplyPatchExecutor.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/patch/ApplyPatchExecutor.java @@ -38,5 +38,5 @@ public interface ApplyPatchExecutor { void apply(@NotNull List remaining, @NotNull final MultiMap patchGroupsToApply, @Nullable final LocalChangeList localList, @Nullable String fileName, - @Nullable ThrowableComputable>, PatchSyntaxException> additionalInfo); + @Nullable ThrowableComputable>, PatchSyntaxException> additionalInfo); } diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/patch/ImportToShelfExecutor.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/patch/ImportToShelfExecutor.java index 605a08db58fb..c795479380a1 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/patch/ImportToShelfExecutor.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/patch/ImportToShelfExecutor.java @@ -53,7 +53,7 @@ public class ImportToShelfExecutor implements ApplyPatchExecutor remaining, @NotNull final MultiMap patchGroupsToApply, @Nullable LocalChangeList localList, @Nullable final String fileName, - @Nullable ThrowableComputable>, PatchSyntaxException> additionalInfo) { + @Nullable ThrowableComputable>, PatchSyntaxException> additionalInfo) { if (fileName == null) { LOG.error("Patch file name shouldn't be null"); return; diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/patch/UnshelvePatchDefaultExecutor.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/patch/UnshelvePatchDefaultExecutor.java index 788e5e531430..cb4b090ff051 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/patch/UnshelvePatchDefaultExecutor.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/patch/UnshelvePatchDefaultExecutor.java @@ -41,7 +41,7 @@ public class UnshelvePatchDefaultExecutor extends ApplyPatchDefaultExecutor { @NotNull MultiMap patchGroupsToApply, @Nullable LocalChangeList localList, @Nullable String fileName, - @Nullable ThrowableComputable>, PatchSyntaxException> additionalInfo) { + @Nullable ThrowableComputable>, PatchSyntaxException> additionalInfo) { final CommitContext commitContext = new CommitContext(); applyAdditionalInfoBefore(myProject, additionalInfo, commitContext); final Collection appliers = getPatchAppliers(patchGroupsToApply, localList, commitContext); diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/shelf/ShelfFileProcessorUtil.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/shelf/ShelfFileProcessorUtil.java index d3cbe2323471..a424691ebe44 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/shelf/ShelfFileProcessorUtil.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/shelf/ShelfFileProcessorUtil.java @@ -19,7 +19,7 @@ public class ShelfFileProcessorUtil { public static void savePatchFile(@Nullable Project project, @NotNull File patchFile, List patches, - @Nullable List extensions, + @Nullable List extensions, @NotNull CommitContext context) throws IOException { try (Writer writer = new OutputStreamWriter(new FileOutputStream(patchFile), StandardCharsets.UTF_8)) { UnifiedDiffWriter.write(project, patches, writer, "\n", chooseNotNull(extensions, UnifiedDiffWriter.getPatchExtensions(project)), context); diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/shelf/ShelvedChangesViewManager.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/shelf/ShelvedChangesViewManager.java index 92957a0214f1..a141c0991485 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/shelf/ShelvedChangesViewManager.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/shelf/ShelvedChangesViewManager.java @@ -243,15 +243,15 @@ public class ShelvedChangesViewManager implements Disposable { super(ShelvedChangesViewManager.this.myProject, myTree.getGrouping()); } - public void setShelvedLists(@NotNull List shelvedLists) { + public void setShelvedLists(@NotNull List shelvedLists) { createShelvedListsWithChangesNode(shelvedLists, myRoot); } - public void setDeletedShelvedLists(@NotNull List shelvedLists) { + public void setDeletedShelvedLists(@NotNull List shelvedLists) { createShelvedListsWithChangesNode(shelvedLists, createTagNode("Recently Deleted")); } - private void createShelvedListsWithChangesNode(@NotNull List shelvedLists, @NotNull MutableTreeNode parentNode) { + private void createShelvedListsWithChangesNode(@NotNull List shelvedLists, @NotNull MutableTreeNode parentNode) { shelvedLists.forEach(changeList -> { List shelvedChanges = new ArrayList<>(); requireNonNull(changeList.getChanges()).stream().map(ShelvedWrapper::new).forEach(shelvedChanges::add); diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/LocalChangesUnderRoots.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/LocalChangesUnderRoots.java index 90696ecd18f9..269fbe84b5ce 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/LocalChangesUnderRoots.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/LocalChangesUnderRoots.java @@ -43,7 +43,7 @@ public class LocalChangesUnderRoots { myVcsManager = projectLevelVcsManager; } - public Map>> getChangesByLists(@NotNull Collection rootsToSave) { + public Map>> getChangesByLists(@NotNull Collection rootsToSave) { final Map>> result = new HashMap<>(); myRoots = myVcsManager.getAllVcsRoots(); @@ -63,7 +63,7 @@ public class LocalChangesUnderRoots { * @return a map, whose keys are VCS roots (from the specified list) and values are {@link Change changes} from these roots. */ @NotNull - public Map> getChangesUnderRoots(@NotNull Collection rootsToSave) { + public Map> getChangesUnderRoots(@NotNull Collection rootsToSave) { Map> result = new HashMap<>(); final Collection allChanges = myChangeManager.getAllChanges(); myRoots = myVcsManager.getAllVcsRoots(); @@ -72,7 +72,7 @@ public class LocalChangesUnderRoots { return result; } - private void addChangesToMap(Collection rootsToSave, + private void addChangesToMap(Collection rootsToSave, Map> result, Collection allChanges) { for (Change change : allChanges) { @@ -85,13 +85,13 @@ public class LocalChangesUnderRoots { } } - private void addChangeToMap(@NotNull Map> result, @NotNull Change change, @NotNull ContentRevision revision, @NotNull Collection rootsToSave) { + private void addChangeToMap(@NotNull Map> result, @NotNull Change change, @NotNull ContentRevision revision, @NotNull Collection rootsToSave) { VirtualFile root = getRootForPath(revision.getFile(), rootsToSave); addChangeToMap(result, root, change); } @Nullable - private VirtualFile getRootForPath(@NotNull FilePath file, @NotNull Collection rootsToSave) { + private VirtualFile getRootForPath(@NotNull FilePath file, @NotNull Collection rootsToSave) { final VirtualFile vf = ChangesUtil.findValidParentUnderReadAction(file); if (vf == null) { return null; diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/ProjectLevelVcsManagerImpl.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/ProjectLevelVcsManagerImpl.java index 0a42c8511580..5e050d582856 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/ProjectLevelVcsManagerImpl.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/ProjectLevelVcsManagerImpl.java @@ -481,7 +481,7 @@ public class ProjectLevelVcsManagerImpl extends ProjectLevelVcsManagerEx impleme setAutoDirectoryMappings(ContainerUtil.append(myMappings.getDirectoryMappings(), new VcsDirectoryMapping(path, activeVcsName))); } - public void setAutoDirectoryMappings(@NotNull List mappings) { + public void setAutoDirectoryMappings(@NotNull List mappings) { myMappings.setDirectoryMappings(mappings); myMappings.cleanupMappings(); } diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/projectlevelman/NewMappings.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/projectlevelman/NewMappings.java index 788b90bf8b3e..94fe793850c9 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/projectlevelman/NewMappings.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/projectlevelman/NewMappings.java @@ -524,11 +524,11 @@ public class NewMappings implements Disposable { } private static class MyVcsActivator { - @NotNull private final Collection myAddVcses; - @NotNull private final Collection myRemoveVcses; + @NotNull private final Collection myAddVcses; + @NotNull private final Collection myRemoveVcses; - private MyVcsActivator(@NotNull Collection addVcses, - @NotNull Collection removeVcses) { + private MyVcsActivator(@NotNull Collection addVcses, + @NotNull Collection removeVcses) { myAddVcses = addVcses; myRemoveVcses = removeVcses; } diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/roots/VcsRootDetectorImpl.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/roots/VcsRootDetectorImpl.java index fc4b1a6ec7fe..1e1df2f14b52 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/roots/VcsRootDetectorImpl.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/roots/VcsRootDetectorImpl.java @@ -116,7 +116,7 @@ public class VcsRootDetectorImpl implements VcsRootDetector { return roots; } - private static boolean shouldScanAbove(@NotNull VirtualFile startDir, @NotNull Set rootsInsideDir) { + private static boolean shouldScanAbove(@NotNull VirtualFile startDir, @NotNull Set rootsInsideDir) { return rootsInsideDir.stream().noneMatch(it -> startDir.equals(it.getPath())); } diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/ui/FlatSpeedSearchPopup.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/ui/FlatSpeedSearchPopup.java index 5e94a4a472b5..a5484e02835e 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/ui/FlatSpeedSearchPopup.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/ui/FlatSpeedSearchPopup.java @@ -32,7 +32,7 @@ public class FlatSpeedSearchPopup extends PopupFactoryImpl.ActionGroupPopup { public FlatSpeedSearchPopup(String title, @NotNull ActionGroup actionGroup, @NotNull DataContext dataContext, - @Nullable Condition preselectActionCondition, boolean showDisableActions) { + @Nullable Condition preselectActionCondition, boolean showDisableActions) { super(title, actionGroup, dataContext, false, false, showDisableActions, false, null, -1, preselectActionCondition, null); } diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/update/AbstractCommonUpdateAction.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/update/AbstractCommonUpdateAction.java index bb0f91222d6b..1f5e45eb0bdf 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/update/AbstractCommonUpdateAction.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/update/AbstractCommonUpdateAction.java @@ -613,7 +613,7 @@ public abstract class AbstractCommonUpdateAction extends AbstractVcsAction imple } } - public static boolean showsCustomNotification(@NotNull Collection vcss) { + public static boolean showsCustomNotification(@NotNull Collection vcss) { return ContainerUtil.all(vcss, vcs -> { UpdateEnvironment environment = vcs.getUpdateEnvironment(); return environment != null && environment.hasCustomNotification(); diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/update/UpdateInfoTree.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/update/UpdateInfoTree.java index 0dd02cab562a..b23f018db93c 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/update/UpdateInfoTree.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/update/UpdateInfoTree.java @@ -66,7 +66,7 @@ public class UpdateInfoTree extends PanelWithActionsAndCloseButton { private boolean myCanGroupByChangeList = false; private boolean myGroupByChangeList = false; private JLabel myLoadingChangeListsLabel; - private List myCommittedChangeLists; + private List myCommittedChangeLists; private final JPanel myCenterPanel = new JPanel(new CardLayout()); @NonNls private static final String CARD_STATUS = "Status"; @NonNls private static final String CARD_CHANGES = "Changes"; @@ -368,7 +368,7 @@ public class UpdateInfoTree extends PanelWithActionsAndCloseButton { } } - public void setChangeLists(final List receivedChanges) { + public void setChangeLists(final List receivedChanges) { final boolean hasEmptyCaches = CommittedChangesCache.getInstance(myProject).hasEmptyCaches(); ApplicationManager.getApplication().invokeLater(() -> { diff --git a/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/filter/BranchPopupBuilder.java b/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/filter/BranchPopupBuilder.java index 1a07803e4e1e..9198681e2df0 100644 --- a/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/filter/BranchPopupBuilder.java +++ b/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/filter/BranchPopupBuilder.java @@ -17,11 +17,11 @@ import java.util.*; public abstract class BranchPopupBuilder { @NotNull protected final VcsLogDataPack myDataPack; - @Nullable private final Collection myVisibleRoots; + @Nullable private final Collection myVisibleRoots; @Nullable private final List> myRecentItems; protected BranchPopupBuilder(@NotNull VcsLogDataPack dataPack, - @Nullable Collection visibleRoots, + @Nullable Collection visibleRoots, @Nullable List> recentItems) { myDataPack = dataPack; myVisibleRoots = visibleRoots; @@ -48,7 +48,7 @@ public abstract class BranchPopupBuilder { } private static Groups prepareGroups(@NotNull VcsLogDataPack dataPack, - @Nullable Collection visibleRoots, + @Nullable Collection visibleRoots, @Nullable List> recentItems) { Groups filteredGroups = new Groups(); Collection allRefs = dataPack.getRefs().getBranches(); diff --git a/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/changes/committed/MockCommittedChangesProvider.java b/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/changes/committed/MockCommittedChangesProvider.java index 277df7262ea6..de4698c374eb 100644 --- a/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/changes/committed/MockCommittedChangesProvider.java +++ b/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/changes/committed/MockCommittedChangesProvider.java @@ -54,7 +54,7 @@ public class MockCommittedChangesProvider implements CachingCommittedChangesProv public void loadCommittedChanges(ChangeBrowserSettings settings, RepositoryLocation location, int maxCount, - AsynchConsumer consumer) { + AsynchConsumer consumer) { ++ myRefreshCount; for (CommittedChangeListImpl changeList : myChangeLists) { consumer.consume(changeList); diff --git a/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/changeBrowser/CvsCommittedChangesProvider.java b/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/changeBrowser/CvsCommittedChangesProvider.java index c74728be82e2..e024de95fe53 100644 --- a/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/changeBrowser/CvsCommittedChangesProvider.java +++ b/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/changeBrowser/CvsCommittedChangesProvider.java @@ -213,7 +213,7 @@ public class CvsCommittedChangesProvider implements CachingCommittedChangesProvi public void loadCommittedChanges(ChangeBrowserSettings settings, RepositoryLocation location, int maxCount, - final AsynchConsumer consumer) + final AsynchConsumer consumer) throws VcsException { try { final CvsRepositoryLocation cvsLocation = (CvsRepositoryLocation) location; diff --git a/plugins/git4idea/src/git4idea/GitTaskHandler.java b/plugins/git4idea/src/git4idea/GitTaskHandler.java index 36b9bb61f074..f712aacd15b7 100644 --- a/plugins/git4idea/src/git4idea/GitTaskHandler.java +++ b/plugins/git4idea/src/git4idea/GitTaskHandler.java @@ -33,12 +33,12 @@ final class GitTaskHandler extends DvcsTaskHandler { } @Override - protected void checkout(@NotNull String taskName, @NotNull List repos, @Nullable Runnable callInAwtLater) { + protected void checkout(@NotNull String taskName, @NotNull List repos, @Nullable Runnable callInAwtLater) { myBrancher.checkout(taskName, false, repos, callInAwtLater); } @Override - protected void checkoutAsNewBranch(@NotNull String name, @NotNull List repositories) { + protected void checkoutAsNewBranch(@NotNull String name, @NotNull List repositories) { myBrancher.checkoutNewBranch(name, repositories); } @@ -48,7 +48,7 @@ final class GitTaskHandler extends DvcsTaskHandler { } @Override - protected void mergeAndClose(@NotNull String branch, @NotNull List repositories) { + protected void mergeAndClose(@NotNull String branch, @NotNull List repositories) { myBrancher.merge(branch, GitBrancher.DeleteOnMergeOption.DELETE, repositories); } diff --git a/plugins/git4idea/src/git4idea/GitUtil.java b/plugins/git4idea/src/git4idea/GitUtil.java index 3ffd4c165a11..e91a03c61b82 100644 --- a/plugins/git4idea/src/git4idea/GitUtil.java +++ b/plugins/git4idea/src/git4idea/GitUtil.java @@ -1083,7 +1083,7 @@ public class GitUtil { } @NotNull - public static Map getCurrentRevisions(@NotNull Collection repositories) { + public static Map getCurrentRevisions(@NotNull Collection repositories) { Map result = new LinkedHashMap<>(); for (GitRepository repository : repositories) { String currentRevision = repository.getCurrentRevision(); diff --git a/plugins/git4idea/src/git4idea/actions/BasicAction.java b/plugins/git4idea/src/git4idea/actions/BasicAction.java index c63c5aaedfe2..71f7626cc9a7 100644 --- a/plugins/git4idea/src/git4idea/actions/BasicAction.java +++ b/plugins/git4idea/src/git4idea/actions/BasicAction.java @@ -111,7 +111,7 @@ public abstract class BasicAction extends DumbAwareAction { * @param file the file whose children should be added to the result list * (recursively) */ - private void addChildren(@NotNull final Project project, @NotNull final List files, @NotNull VirtualFile file) { + private void addChildren(@NotNull final Project project, @NotNull final List files, @NotNull VirtualFile file) { VfsUtilCore.visitChildrenRecursively(file, new VirtualFileVisitor(SKIP_ROOT, null) { @Override public boolean visitFile(@NotNull VirtualFile file) { diff --git a/plugins/git4idea/src/git4idea/actions/GitAdd.java b/plugins/git4idea/src/git4idea/actions/GitAdd.java index 2195c2767e2a..fef3463d000b 100644 --- a/plugins/git4idea/src/git4idea/actions/GitAdd.java +++ b/plugins/git4idea/src/git4idea/actions/GitAdd.java @@ -78,7 +78,7 @@ public class GitAdd extends ScheduleForAdditionAction { !toAdd.isEmpty() ? (indicator, exceptions) -> addPathsToVcs(project, toAdd, exceptions) : null); } - private static void addPathsToVcs(@NotNull Project project, @NotNull Collection toAdd, @NotNull List exceptions) { + private static void addPathsToVcs(@NotNull Project project, @NotNull Collection toAdd, @NotNull List exceptions) { VcsUtil.groupByRoots(project, toAdd, identity()).forEach((vcsRoot, paths) -> { try { if (!(vcsRoot.getVcs() instanceof GitVcs)) return; @@ -96,7 +96,7 @@ public class GitAdd extends ScheduleForAdditionAction { } @NotNull - private static Stream collectPathsFromChanges(@NotNull Project project, @NotNull Stream allChanges) { + private static Stream collectPathsFromChanges(@NotNull Project project, @NotNull Stream allChanges) { ProjectLevelVcsManager vcsManager = ProjectLevelVcsManager.getInstance(project); return allChanges @@ -109,7 +109,7 @@ public class GitAdd extends ScheduleForAdditionAction { } @NotNull - private static Stream collectPathsFromFiles(@NotNull Project project, @NotNull Stream allFiles) { + private static Stream collectPathsFromFiles(@NotNull Project project, @NotNull Stream allFiles) { ProjectLevelVcsManager vcsManager = ProjectLevelVcsManager.getInstance(project); ChangeListManager changeListManager = ChangeListManager.getInstance(project); diff --git a/plugins/git4idea/src/git4idea/actions/GitMergeAction.java b/plugins/git4idea/src/git4idea/actions/GitMergeAction.java index 50167dcfeeac..74a8ba39de6d 100644 --- a/plugins/git4idea/src/git4idea/actions/GitMergeAction.java +++ b/plugins/git4idea/src/git4idea/actions/GitMergeAction.java @@ -184,7 +184,7 @@ abstract class GitMergeAction extends GitRepositoryAction { } private static void showUpdates(@NotNull Project project, - @NotNull List exceptions, + @NotNull List exceptions, @NotNull VirtualFile root, @NotNull GitRevisionNumber currentRev, @NotNull Label beforeLabel, diff --git a/plugins/git4idea/src/git4idea/actions/GitRepositoryAction.java b/plugins/git4idea/src/git4idea/actions/GitRepositoryAction.java index 7b97dc21394c..9c262fefc6d0 100644 --- a/plugins/git4idea/src/git4idea/actions/GitRepositoryAction.java +++ b/plugins/git4idea/src/git4idea/actions/GitRepositoryAction.java @@ -47,7 +47,7 @@ public abstract class GitRepositoryAction extends DumbAwareAction { @NotNull @CalledInAwt - private static VirtualFile getDefaultRoot(@NotNull Project project, @NotNull List roots, @Nullable VirtualFile[] vFiles) { + private static VirtualFile getDefaultRoot(@NotNull Project project, @NotNull List roots, @Nullable VirtualFile[] vFiles) { if (vFiles != null) { for (VirtualFile file : vFiles) { GitRepository repository = GitRepositoryManager.getInstance(project).getRepositoryForFile(file); diff --git a/plugins/git4idea/src/git4idea/branch/DeepCompareAction.java b/plugins/git4idea/src/git4idea/branch/DeepCompareAction.java index 933fa16516f4..4e0086eb0582 100644 --- a/plugins/git4idea/src/git4idea/branch/DeepCompareAction.java +++ b/plugins/git4idea/src/git4idea/branch/DeepCompareAction.java @@ -86,8 +86,8 @@ public class DeepCompareAction extends ToggleAction implements DumbAware { private static void selectBranchAndPerformAction(@NotNull VcsLogUi ui, @NotNull AnActionEvent event, - @NotNull Consumer consumer, - @NotNull Collection visibleRoots) { + @NotNull Consumer consumer, + @NotNull Collection visibleRoots) { VcsLogDataPack dataPack = ui.getDataPack(); ActionGroup actionGroup = new BranchPopupBuilder(dataPack, visibleRoots, null) { @NotNull @@ -139,7 +139,7 @@ public class DeepCompareAction extends ToggleAction implements DumbAware { return ContainerUtil.filter(VcsLogUtil.getVisibleRoots(ui), root -> isGitRoot(project, root)); } - private static boolean hasGitRoots(@NotNull Project project, @NotNull Set roots) { + private static boolean hasGitRoots(@NotNull Project project, @NotNull Set roots) { return ContainerUtil.exists(roots, root -> isGitRoot(project, root)); } diff --git a/plugins/git4idea/src/git4idea/branch/GitBranchIncomingOutgoingManager.java b/plugins/git4idea/src/git4idea/branch/GitBranchIncomingOutgoingManager.java index e2100bfb6eec..3340d842c3d0 100644 --- a/plugins/git4idea/src/git4idea/branch/GitBranchIncomingOutgoingManager.java +++ b/plugins/git4idea/src/git4idea/branch/GitBranchIncomingOutgoingManager.java @@ -248,7 +248,7 @@ public class GitBranchIncomingOutgoingManager implements GitRepositoryChangeList @NotNull private Map calcBranchesToPullForRemote(@NotNull GitRepository repository, @NotNull GitRemote gitRemote, - @NotNull Collection trackInfoList, + @NotNull Collection trackInfoList, GitAuthenticationMode mode) { Map result = new HashMap<>(); GitBranchesCollection branchesCollection = repository.getBranches(); diff --git a/plugins/git4idea/src/git4idea/branch/GitBranchOperation.java b/plugins/git4idea/src/git4idea/branch/GitBranchOperation.java index 557918981304..3d03a7fb8bc0 100644 --- a/plugins/git4idea/src/git4idea/branch/GitBranchOperation.java +++ b/plugins/git4idea/src/git4idea/branch/GitBranchOperation.java @@ -30,6 +30,7 @@ import com.intellij.openapi.vcs.VcsNotifier; import com.intellij.openapi.vcs.changes.Change; import com.intellij.openapi.vcs.changes.ChangesUtil; import com.intellij.openapi.vfs.VirtualFile; +import com.intellij.util.containers.ContainerUtil; import com.intellij.util.containers.MultiMap; import git4idea.GitUtil; import git4idea.changes.GitChangeUtils; @@ -68,14 +69,14 @@ abstract class GitBranchOperation { @NotNull private final Collection myRemainingRepositories; protected GitBranchOperation(@NotNull Project project, @NotNull Git git, - @NotNull GitBranchUiHandler uiHandler, @NotNull Collection repositories) { + @NotNull GitBranchUiHandler uiHandler, @NotNull Collection repositories) { myProject = project; myGit = git; myUiHandler = uiHandler; myRepositories = getRepositoryManager(project).sortByDependency(repositories); - myCurrentHeads = Maps.toMap(repositories, repo -> chooseNotNull(repo.getCurrentBranchName(), repo.getCurrentRevision())); - myInitialRevisions = Maps.toMap(repositories, GitRepository::getCurrentRevision); + myCurrentHeads = ContainerUtil.newMapFromKeys(repositories.iterator(), repo -> chooseNotNull(repo.getCurrentBranchName(), repo.getCurrentRevision())); + myInitialRevisions = ContainerUtil.newMapFromKeys(repositories.iterator(), GitRepository::getCurrentRevision); mySuccessfulRepositories = new ArrayList<>(); mySkippedRepositories = new ArrayList<>(); myRemainingRepositories = new ArrayList<>(myRepositories); @@ -353,7 +354,7 @@ abstract class GitBranchOperation { * local changes. */ @NotNull - Map> collectLocalChangesConflictingWithBranch(@NotNull Collection repositories, + Map> collectLocalChangesConflictingWithBranch(@NotNull Collection repositories, @NotNull String otherBranch) { Map> changes = new HashMap<>(); for (GitRepository repository : repositories) { diff --git a/plugins/git4idea/src/git4idea/branch/GitBranchUiHandler.java b/plugins/git4idea/src/git4idea/branch/GitBranchUiHandler.java index 467b7bce5b47..a1d7c48f468a 100644 --- a/plugins/git4idea/src/git4idea/branch/GitBranchUiHandler.java +++ b/plugins/git4idea/src/git4idea/branch/GitBranchUiHandler.java @@ -45,7 +45,7 @@ public interface GitBranchUiHandler { * @param operationName * @param repositories */ - void showUnmergedFilesNotification(@NotNull String operationName, @NotNull Collection repositories); + void showUnmergedFilesNotification(@NotNull String operationName, @NotNull Collection repositories); /** * Shows a modal notification about unmerged files preventing an operation, with "Rollback" button. @@ -78,7 +78,7 @@ public interface GitBranchUiHandler { */ @NotNull GitSmartOperationDialog.Choice showSmartOperationDialog(@NotNull Project project, - @NotNull List changes, + @NotNull List changes, @NotNull Collection paths, @NotNull String operation, @Nullable String forceButtonTitle); diff --git a/plugins/git4idea/src/git4idea/branch/GitBranchUiHandlerImpl.java b/plugins/git4idea/src/git4idea/branch/GitBranchUiHandlerImpl.java index ce96c66efee9..1b9c634e7f83 100644 --- a/plugins/git4idea/src/git4idea/branch/GitBranchUiHandlerImpl.java +++ b/plugins/git4idea/src/git4idea/branch/GitBranchUiHandlerImpl.java @@ -65,7 +65,7 @@ public class GitBranchUiHandlerImpl implements GitBranchUiHandler { } @Override - public void showUnmergedFilesNotification(@NotNull final String operationName, @NotNull final Collection repositories) { + public void showUnmergedFilesNotification(@NotNull final String operationName, @NotNull final Collection repositories) { String title = unmergedFilesErrorTitle(operationName); String description = unmergedFilesErrorNotificationDescription(operationName); VcsNotifier.getInstance(myProject).notifyError(title, description, @@ -118,7 +118,7 @@ public class GitBranchUiHandlerImpl implements GitBranchUiHandler { @NotNull @Override public GitSmartOperationDialog.Choice showSmartOperationDialog(@NotNull Project project, - @NotNull List changes, + @NotNull List changes, @NotNull Collection paths, @NotNull String operation, @Nullable String forceButtonTitle) { diff --git a/plugins/git4idea/src/git4idea/branch/GitBranchUtil.java b/plugins/git4idea/src/git4idea/branch/GitBranchUtil.java index f785b3e823a2..74b1e80dee15 100644 --- a/plugins/git4idea/src/git4idea/branch/GitBranchUtil.java +++ b/plugins/git4idea/src/git4idea/branch/GitBranchUtil.java @@ -61,7 +61,7 @@ public class GitBranchUtil { } @NotNull - static String getCurrentBranchOrRev(@NotNull Collection repositories) { + static String getCurrentBranchOrRev(@NotNull Collection repositories) { if (repositories.size() > 1) { GitMultiRootBranchConfig multiRootBranchConfig = new GitMultiRootBranchConfig(repositories); String currentBranch = multiRootBranchConfig.getCurrentBranch(); @@ -237,7 +237,7 @@ public class GitBranchUtil { */ @Nullable public static GitNewBranchOptions getNewBranchNameFromUser(@NotNull Project project, - @NotNull Collection repositories, + @NotNull Collection repositories, @NotNull String dialogTitle, @Nullable String initialName) { return new GitNewBranchDialog(project, dialogTitle, initialName, GitNewBranchNameValidator.newInstance(repositories)).showAndGetOptions(); diff --git a/plugins/git4idea/src/git4idea/branch/GitBranchWorker.java b/plugins/git4idea/src/git4idea/branch/GitBranchWorker.java index 65ad04f69bcc..9210ab119047 100644 --- a/plugins/git4idea/src/git4idea/branch/GitBranchWorker.java +++ b/plugins/git4idea/src/git4idea/branch/GitBranchWorker.java @@ -51,7 +51,7 @@ public final class GitBranchWorker { myUiHandler = uiHandler; } - public void checkoutNewBranch(@NotNull final String name, @NotNull List repositories) { + public void checkoutNewBranch(@NotNull final String name, @NotNull List repositories) { updateInfo(repositories); repositories = ContainerUtil.filter(repositories, repository -> { GitLocalBranch currentBranch = repository.getCurrentBranch(); @@ -70,7 +70,7 @@ public final class GitBranchWorker { new GitCreateBranchOperation(myProject, myGit, myUiHandler, name, startPoints).execute(); } - public void createNewTag(@NotNull final String name, @NotNull final String reference, @NotNull final List repositories) { + public void createNewTag(@NotNull final String name, @NotNull final String reference, @NotNull final List repositories) { for (GitRepository repository : repositories) { myGit.createNewTag(repository, name, null, reference); repository.getRepositoryFiles().refreshTagsFiles(); @@ -78,23 +78,23 @@ public final class GitBranchWorker { } public void checkoutNewBranchStartingFrom(@NotNull String newBranchName, @NotNull String startPoint, - @NotNull List repositories) { + @NotNull List repositories) { updateInfo(repositories); new GitCheckoutOperation(myProject, myGit, myUiHandler, repositories, startPoint, false, true, newBranchName).execute(); } - public void checkout(@NotNull final String reference, boolean detach, @NotNull List repositories) { + public void checkout(@NotNull final String reference, boolean detach, @NotNull List repositories) { updateInfo(repositories); new GitCheckoutOperation(myProject, myGit, myUiHandler, repositories, reference, detach, false, null).execute(); } - public void deleteBranch(@NotNull final String branchName, @NotNull final List repositories) { + public void deleteBranch(@NotNull final String branchName, @NotNull final List repositories) { updateInfo(repositories); new GitDeleteBranchOperation(myProject, myGit, myUiHandler, repositories, branchName).execute(); } - public void deleteTag(@NotNull final String tagName, @NotNull final List repositories) { + public void deleteTag(@NotNull final String tagName, @NotNull final List repositories) { updateInfo(repositories); new GitDeleteTagOperation(myProject, myGit, myUiHandler, repositories, tagName).execute(); } @@ -104,29 +104,29 @@ public final class GitBranchWorker { new GitDeleteRemoteTagOperation(myProject, myGit, myUiHandler, repositories, tagName).execute(); } - public void deleteRemoteBranch(@NotNull final String branchName, @NotNull final List repositories) { + public void deleteRemoteBranch(@NotNull final String branchName, @NotNull final List repositories) { updateInfo(repositories); new GitDeleteRemoteBranchOperation(myProject, myGit, myUiHandler, repositories, branchName).execute(); } public void merge(@NotNull final String branchName, @NotNull final GitBrancher.DeleteOnMergeOption deleteOnMerge, - @NotNull final List repositories) { + @NotNull final List repositories) { updateInfo(repositories); new GitMergeOperation(myProject, myGit, myUiHandler, repositories, branchName, deleteOnMerge).execute(); } - public void rebase(@NotNull List repositories, @NotNull String branchName) { + public void rebase(@NotNull List repositories, @NotNull String branchName) { updateInfo(repositories); GitRebaseUtils.rebase(myProject, repositories, new GitRebaseParams(branchName), myUiHandler.getProgressIndicator()); } - public void rebaseOnCurrent(@NotNull List repositories, @NotNull String branchName) { + public void rebaseOnCurrent(@NotNull List repositories, @NotNull String branchName) { updateInfo(repositories); GitRebaseUtils.rebase(myProject, repositories, new GitRebaseParams(branchName, null, "HEAD", false, false), myUiHandler.getProgressIndicator()); } - public void renameBranch(@NotNull String currentName, @NotNull String newName, @NotNull List repositories) { + public void renameBranch(@NotNull String currentName, @NotNull String newName, @NotNull List repositories) { updateInfo(repositories); new GitRenameBranchOperation(myProject, myGit, myUiHandler, currentName, newName, repositories).execute(); } @@ -137,7 +137,7 @@ public final class GitBranchWorker { return GitChangeUtils.getDiffWithWorkingDir(repository.getProject(), repository.getRoot(), branchName, null, true); } - private static void updateInfo(@NotNull Collection repositories) { + private static void updateInfo(@NotNull Collection repositories) { for (GitRepository repository : repositories) { repository.update(); } diff --git a/plugins/git4idea/src/git4idea/branch/GitBrancher.java b/plugins/git4idea/src/git4idea/branch/GitBrancher.java index fdc355c6bfbe..7bee93ad9858 100644 --- a/plugins/git4idea/src/git4idea/branch/GitBrancher.java +++ b/plugins/git4idea/src/git4idea/branch/GitBrancher.java @@ -44,11 +44,10 @@ public interface GitBrancher { *

Doesn't check the name of new branch for validity - * do this before calling this method, otherwise a standard error dialog will be shown.

*

Equivalent to {@code git checkout }

- * - * @param name name of the new branch to check out. + * @param name name of the new branch to check out. * @param repositories repositories to operate on. */ - void checkoutNewBranch(@NotNull String name, @NotNull List repositories); + void checkoutNewBranch(@NotNull String name, @NotNull List repositories); /** * Creates new branch without checking it out. @@ -61,14 +60,13 @@ public interface GitBrancher { /** *

Creates new tag on the selected reference.

- * - * @param name the name of new tag. + * @param name the name of new tag. * @param reference the reference which tag will point to. * @param repositories repositories to operate on. * @param callInAwtLater the Runnable that should be called after execution of the method (both successful and unsuccessful). - * If given, it will be called in the EDT {@link javax.swing.SwingUtilities#invokeLater(Runnable) later}. +* If given, it will be called in the EDT {@link javax.swing.SwingUtilities#invokeLater(Runnable) later}. */ - void createNewTag(@NotNull String name, @NotNull String reference, @NotNull List repositories, + void createNewTag(@NotNull String name, @NotNull String reference, @NotNull List repositories, @Nullable Runnable callInAwtLater); /** @@ -83,22 +81,21 @@ public interface GitBrancher { * create a local branch tracking the given remote branch, checkout hash or tag into the detached HEAD. * @param repositories repositories to operate on. * @param callInAwtLater the Runnable that should be called after execution of the method (both successful and unsuccessful). - * If given, it will be called in the EDT {@link javax.swing.SwingUtilities#invokeLater(Runnable) later}. +* If given, it will be called in the EDT {@link javax.swing.SwingUtilities#invokeLater(Runnable) later}. */ - void checkout(@NotNull String reference, boolean detach, @NotNull List repositories, @Nullable Runnable callInAwtLater); + void checkout(@NotNull String reference, boolean detach, @NotNull List repositories, @Nullable Runnable callInAwtLater); /** * Creates and checks out a new local branch starting from the given reference: * {@code git checkout -b }.
* Provides the "smart checkout" procedure the same as in {@link #checkout(String, boolean, List, Runnable)}. - * - * @param newBranchName the name of the new local branch. + * @param newBranchName the name of the new local branch. * @param startPoint the reference to checkout. * @param repositories repositories to operate on. * @param callInAwtLater the Runnable that should be called after execution of the method (both successful and unsuccessful). - * If given, it will be called in the EDT {@link javax.swing.SwingUtilities#invokeLater(Runnable) later}. +* If given, it will be called in the EDT {@link javax.swing.SwingUtilities#invokeLater(Runnable) later}. */ - void checkoutNewBranchStartingFrom(@NotNull String newBranchName, @NotNull String startPoint, @NotNull List repositories, + void checkoutNewBranchStartingFrom(@NotNull String newBranchName, @NotNull String startPoint, @NotNull List repositories, @Nullable Runnable callInAwtLater); /** @@ -107,62 +104,59 @@ public interface GitBrancher { *

If the branch can't be deleted, because it is unmerged neither to the HEAD nor to its upstream, * displays a dialog showing commits that are not merged and proposing to execute force deletion:

*

{@code git branch -D }

- * - * @param branchName the name of the branch to be deleted. + * @param branchName the name of the branch to be deleted. * @param repositories repositories to operate on. */ - void deleteBranch(@NotNull String branchName, @NotNull List repositories); + void deleteBranch(@NotNull String branchName, @NotNull List repositories); /** *

Deletes the remote branch:

*

{@code git push :}

- * - * @param branchName name of the remote branch to delete. + * @param branchName name of the remote branch to delete. * @param repositories Repositories to operate on. */ - void deleteRemoteBranch(@NotNull String branchName, @NotNull List repositories); + void deleteRemoteBranch(@NotNull String branchName, @NotNull List repositories); /** * Compares commits from the HEAD with the specified branch. */ - void compare(@NotNull String branchName, @NotNull List repositories, @NotNull GitRepository selectedRepository); + void compare(@NotNull String branchName, @NotNull List repositories, @NotNull GitRepository selectedRepository); /** * Compares the current working tree with its state in the selected branch. */ - void showDiffWithLocal(@NotNull String branchName, @NotNull List repositories); + void showDiffWithLocal(@NotNull String branchName, @NotNull List repositories); /** *

Merges the given branch to the HEAD.

*

{@code git merge }

*

If local changes prevent merging, proposes the "Smart merge" procedure (stash-merge-unstash).

*

If untracked files prevent merging, shows them in an error dialog.

- * - * @param branchName the branch to be merged into HEAD. + * @param branchName the branch to be merged into HEAD. * @param deleteOnMerge specify whether the branch should be automatically deleted or proposed to be deleted after merge. * @param repositories repositories to operate on. */ - void merge(@NotNull String branchName, @NotNull DeleteOnMergeOption deleteOnMerge, @NotNull List repositories); + void merge(@NotNull String branchName, @NotNull DeleteOnMergeOption deleteOnMerge, @NotNull List repositories); /** * Call {@code git rebase } for each of the given repositories. */ - void rebase(@NotNull List repositories, @NotNull String branchName); + void rebase(@NotNull List repositories, @NotNull String branchName); /** * Call {@code git rebase } for each of the given repositories. */ - void rebaseOnCurrent(@NotNull List repositories, @NotNull String branchName); + void rebaseOnCurrent(@NotNull List repositories, @NotNull String branchName); /** * Renames the given branch. */ - void renameBranch(@NotNull String currentName, @NotNull String newName, @NotNull List repositories); + void renameBranch(@NotNull String currentName, @NotNull String newName, @NotNull List repositories); /** * Deletes tag */ - void deleteTag(@NotNull String name, @NotNull List repositories); + void deleteTag(@NotNull String name, @NotNull List repositories); /** * Deletes tag on all remotes diff --git a/plugins/git4idea/src/git4idea/branch/GitBrancherImpl.java b/plugins/git4idea/src/git4idea/branch/GitBrancherImpl.java index dbbfb5439741..06ebf4210c02 100644 --- a/plugins/git4idea/src/git4idea/branch/GitBrancherImpl.java +++ b/plugins/git4idea/src/git4idea/branch/GitBrancherImpl.java @@ -43,7 +43,7 @@ class GitBrancherImpl implements GitBrancher { } @Override - public void checkoutNewBranch(@NotNull String name, @NotNull List repositories) { + public void checkoutNewBranch(@NotNull String name, @NotNull List repositories) { new CommonBackgroundTask(myProject, "Checking out new branch " + name, null) { @Override public void execute(@NotNull ProgressIndicator indicator) { @@ -69,7 +69,7 @@ class GitBrancherImpl implements GitBrancher { @Override public void createNewTag(@NotNull String name, @NotNull String reference, - @NotNull List repositories, + @NotNull List repositories, @Nullable Runnable callInAwtLater) { new CommonBackgroundTask(myProject, "Checking out new branch " + name, callInAwtLater) { @Override @@ -82,7 +82,7 @@ class GitBrancherImpl implements GitBrancher { @Override public void checkout(@NotNull String reference, boolean detach, - @NotNull List repositories, + @NotNull List repositories, @Nullable Runnable callInAwtLater) { new CommonBackgroundTask(myProject, "Checking out " + reference, callInAwtLater) { @Override @@ -95,7 +95,7 @@ class GitBrancherImpl implements GitBrancher { @Override public void checkoutNewBranchStartingFrom(@NotNull String newBranchName, @NotNull String startPoint, - @NotNull List repositories, + @NotNull List repositories, @Nullable Runnable callInAwtLater) { new CommonBackgroundTask(myProject, String.format("Checking out %s from %s", newBranchName, startPoint), callInAwtLater) { @Override @@ -106,7 +106,7 @@ class GitBrancherImpl implements GitBrancher { } @Override - public void deleteBranch(@NotNull String branchName, @NotNull List repositories) { + public void deleteBranch(@NotNull String branchName, @NotNull List repositories) { new CommonBackgroundTask(myProject, "Deleting " + branchName, null) { @Override public void execute(@NotNull ProgressIndicator indicator) { @@ -116,7 +116,7 @@ class GitBrancherImpl implements GitBrancher { } @Override - public void deleteRemoteBranch(@NotNull String branchName, @NotNull List repositories) { + public void deleteRemoteBranch(@NotNull String branchName, @NotNull List repositories) { new CommonBackgroundTask(myProject, "Deleting " + branchName, null) { @Override public void execute(@NotNull ProgressIndicator indicator) { @@ -126,7 +126,7 @@ class GitBrancherImpl implements GitBrancher { } @Override - public void compare(@NotNull String branchName, @NotNull List repositories, + public void compare(@NotNull String branchName, @NotNull List repositories, @NotNull GitRepository selectedRepository) { VcsLogUtil.runWhenLogIsReady(myProject, (log, logManager) -> { VcsLogRangeFilter filters = VcsLogFilterObject.fromRange("HEAD", branchName); @@ -135,12 +135,12 @@ class GitBrancherImpl implements GitBrancher { } @Override - public void showDiffWithLocal(@NotNull String branchName, @NotNull List repositories) { + public void showDiffWithLocal(@NotNull String branchName, @NotNull List repositories) { new ShowDiffWithBranchDialog(myProject, branchName, repositories, GitBranchUtil.getCurrentBranchOrRev(repositories)).show(); } @Override - public void merge(@NotNull String branchName, @NotNull DeleteOnMergeOption deleteOnMerge, @NotNull List repositories) { + public void merge(@NotNull String branchName, @NotNull DeleteOnMergeOption deleteOnMerge, @NotNull List repositories) { new CommonBackgroundTask(myProject, "Merging " + branchName, null) { @Override public void execute(@NotNull ProgressIndicator indicator) { @@ -150,7 +150,7 @@ class GitBrancherImpl implements GitBrancher { } @Override - public void rebase(@NotNull List repositories, @NotNull String branchName) { + public void rebase(@NotNull List repositories, @NotNull String branchName) { new CommonBackgroundTask(myProject, "Rebasing onto " + branchName, null) { @Override void execute(@NotNull ProgressIndicator indicator) { @@ -160,7 +160,7 @@ class GitBrancherImpl implements GitBrancher { } @Override - public void rebaseOnCurrent(@NotNull List repositories, @NotNull String branchName) { + public void rebaseOnCurrent(@NotNull List repositories, @NotNull String branchName) { new CommonBackgroundTask(myProject, "Rebasing " + branchName + "...", null) { @Override void execute(@NotNull ProgressIndicator indicator) { @@ -170,7 +170,7 @@ class GitBrancherImpl implements GitBrancher { } @Override - public void renameBranch(@NotNull String currentName, @NotNull String newName, @NotNull List repositories) { + public void renameBranch(@NotNull String currentName, @NotNull String newName, @NotNull List repositories) { new CommonBackgroundTask(myProject, "Renaming " + currentName + " to " + newName + "...", null) { @Override void execute(@NotNull ProgressIndicator indicator) { @@ -180,7 +180,7 @@ class GitBrancherImpl implements GitBrancher { } @Override - public void deleteTag(@NotNull String name, @NotNull List repositories) { + public void deleteTag(@NotNull String name, @NotNull List repositories) { new CommonBackgroundTask(myProject, "Deleting tag " + name, null) { @Override public void execute(@NotNull ProgressIndicator indicator) { diff --git a/plugins/git4idea/src/git4idea/branch/GitCheckoutNewBranchOperation.java b/plugins/git4idea/src/git4idea/branch/GitCheckoutNewBranchOperation.java index 187f98c2b5dd..db3a3f60ce77 100644 --- a/plugins/git4idea/src/git4idea/branch/GitCheckoutNewBranchOperation.java +++ b/plugins/git4idea/src/git4idea/branch/GitCheckoutNewBranchOperation.java @@ -38,7 +38,7 @@ class GitCheckoutNewBranchOperation extends GitBranchOperation { @NotNull private final String myNewBranchName; GitCheckoutNewBranchOperation(@NotNull Project project, @NotNull Git git, @NotNull GitBranchUiHandler uiHandler, - @NotNull Collection repositories, @NotNull String newBranchName) { + @NotNull Collection repositories, @NotNull String newBranchName) { super(project, git, uiHandler, repositories); myNewBranchName = newBranchName; myProject = project; diff --git a/plugins/git4idea/src/git4idea/branch/GitCheckoutOperation.java b/plugins/git4idea/src/git4idea/branch/GitCheckoutOperation.java index 6b5c88df2979..e9943726232c 100644 --- a/plugins/git4idea/src/git4idea/branch/GitCheckoutOperation.java +++ b/plugins/git4idea/src/git4idea/branch/GitCheckoutOperation.java @@ -63,7 +63,7 @@ class GitCheckoutOperation extends GitBranchOperation { GitCheckoutOperation(@NotNull Project project, @NotNull Git git, @NotNull GitBranchUiHandler uiHandler, - @NotNull Collection repositories, + @NotNull Collection repositories, @NotNull String startPointReference, boolean detach, boolean refShouldBeValid, @@ -252,7 +252,7 @@ class GitCheckoutOperation extends GitBranchOperation { } // stash - checkout - unstash - private boolean smartCheckout(@NotNull final List repositories, @NotNull final String reference, + private boolean smartCheckout(@NotNull final List repositories, @NotNull final String reference, @Nullable final String newBranch, @NotNull ProgressIndicator indicator) { AtomicBoolean result = new AtomicBoolean(); GitPreservingProcess preservingProcess = @@ -265,7 +265,7 @@ class GitCheckoutOperation extends GitBranchOperation { /** * Checks out or shows an error message. */ - private boolean checkoutOrNotify(@NotNull List repositories, + private boolean checkoutOrNotify(@NotNull List repositories, @NotNull String reference, @Nullable String newBranch, boolean force) { GitCompoundResult compoundResult = new GitCompoundResult(myProject); for (GitRepository repository : repositories) { diff --git a/plugins/git4idea/src/git4idea/branch/GitDeleteBranchOperation.java b/plugins/git4idea/src/git4idea/branch/GitDeleteBranchOperation.java index ac00e576a65b..9e53e5a1ba9b 100644 --- a/plugins/git4idea/src/git4idea/branch/GitDeleteBranchOperation.java +++ b/plugins/git4idea/src/git4idea/branch/GitDeleteBranchOperation.java @@ -57,7 +57,7 @@ class GitDeleteBranchOperation extends GitBranchOperation { @NotNull private final Map myDeletedBranchTips; GitDeleteBranchOperation(@NotNull Project project, @NotNull Git git, @NotNull GitBranchUiHandler uiHandler, - @NotNull Collection repositories, @NotNull String branchName) { + @NotNull Collection repositories, @NotNull String branchName) { super(project, git, uiHandler, repositories); myBranchName = branchName; myNotifier = VcsNotifier.getInstance(myProject); @@ -275,7 +275,7 @@ class GitDeleteBranchOperation extends GitBranchOperation { } @NotNull - private static Map findTrackedBranches(@NotNull Collection repositories, + private static Map findTrackedBranches(@NotNull Collection repositories, @NotNull String localBranchName) { Map trackedBranches = new HashMap<>(); for (GitRepository repository : repositories) { diff --git a/plugins/git4idea/src/git4idea/branch/GitDeleteRemoteBranchOperation.java b/plugins/git4idea/src/git4idea/branch/GitDeleteRemoteBranchOperation.java index 8e031979f143..3262b4d7bbd1 100644 --- a/plugins/git4idea/src/git4idea/branch/GitDeleteRemoteBranchOperation.java +++ b/plugins/git4idea/src/git4idea/branch/GitDeleteRemoteBranchOperation.java @@ -44,7 +44,7 @@ class GitDeleteRemoteBranchOperation extends GitBranchOperation { private final String myBranchName; GitDeleteRemoteBranchOperation(@NotNull Project project, @NotNull Git git, - @NotNull GitBranchUiHandler handler, @NotNull List repositories, + @NotNull GitBranchUiHandler handler, @NotNull List repositories, @NotNull String name) { super(project, git, handler, repositories); myBranchName = name; @@ -113,11 +113,11 @@ class GitDeleteRemoteBranchOperation extends GitBranchOperation { @NotNull private static Collection getCommonTrackingBranches(@NotNull String remoteBranch, - @NotNull Collection repositories) { + @NotNull Collection repositories) { return new GitMultiRootBranchConfig(repositories).getCommonTrackingBranches(remoteBranch); } - private boolean doDeleteRemote(@NotNull String branchName, @NotNull Collection repositories) { + private boolean doDeleteRemote(@NotNull String branchName, @NotNull Collection repositories) { Couple pair = splitNameOfRemoteBranch(branchName); String remoteName = pair.getFirst(); String branch = pair.getSecond(); diff --git a/plugins/git4idea/src/git4idea/branch/GitDeleteTagOperation.java b/plugins/git4idea/src/git4idea/branch/GitDeleteTagOperation.java index 0398559d973b..0cdc4871d946 100644 --- a/plugins/git4idea/src/git4idea/branch/GitDeleteTagOperation.java +++ b/plugins/git4idea/src/git4idea/branch/GitDeleteTagOperation.java @@ -41,7 +41,7 @@ class GitDeleteTagOperation extends GitBranchOperation { @NotNull private final Map myDeletedTagTips = new HashMap<>(); GitDeleteTagOperation(@NotNull Project project, @NotNull Git git, @NotNull GitBranchUiHandler uiHandler, - @NotNull Collection repositories, @NotNull String tagName) { + @NotNull Collection repositories, @NotNull String tagName) { super(project, git, uiHandler, repositories); myTagName = tagName; myNotifier = VcsNotifier.getInstance(myProject); diff --git a/plugins/git4idea/src/git4idea/branch/GitMergeOperation.java b/plugins/git4idea/src/git4idea/branch/GitMergeOperation.java index 459d8688f88a..971d694479b5 100644 --- a/plugins/git4idea/src/git4idea/branch/GitMergeOperation.java +++ b/plugins/git4idea/src/git4idea/branch/GitMergeOperation.java @@ -45,7 +45,7 @@ class GitMergeOperation extends GitBranchOperation { private GitPreservingProcess myPreservingProcess; GitMergeOperation(@NotNull Project project, @NotNull Git git, @NotNull GitBranchUiHandler uiHandler, - @NotNull Collection repositories, + @NotNull Collection repositories, @NotNull String branchToMerge, GitBrancher.DeleteOnMergeOption deleteOnMerge) { super(project, git, uiHandler, repositories); myBranchToMerge = branchToMerge; @@ -195,7 +195,7 @@ class GitMergeOperation extends GitBranchOperation { } } - private boolean doSmartMerge(@NotNull final Collection repositories) { + private boolean doSmartMerge(@NotNull final Collection repositories) { final AtomicBoolean success = new AtomicBoolean(); myPreservingProcess = new GitPreservingProcess(myProject, myGit, GitUtil.getRootsFromRepositories(repositories), "merge", myBranchToMerge, STASH, getIndicator(), @@ -213,7 +213,7 @@ class GitMergeOperation extends GitBranchOperation { * @return true if merge has succeeded without errors (but possibly with conflicts) in all repositories; * false if it failed at least in one of them. */ - private boolean doMerge(@NotNull Collection repositories) { + private boolean doMerge(@NotNull Collection repositories) { for (GitRepository repository : repositories) { GitSimpleEventDetector mergeConflict = new GitSimpleEventDetector(GitSimpleEventDetector.Event.MERGE_CONFLICT); GitCommandResult result = myGit.merge(repository, myBranchToMerge, Collections.emptyList(), mergeConflict); @@ -279,7 +279,7 @@ class GitMergeOperation extends GitBranchOperation { } @NotNull - private GitCompoundResult smartRollback(@NotNull Collection repositories) { + private GitCompoundResult smartRollback(@NotNull Collection repositories) { LOG.info("Starting smart rollback..."); final GitCompoundResult result = new GitCompoundResult(myProject); Collection roots = GitUtil.getRootsFromRepositories(repositories); diff --git a/plugins/git4idea/src/git4idea/branch/GitRenameBranchOperation.java b/plugins/git4idea/src/git4idea/branch/GitRenameBranchOperation.java index 6051f96a9086..87ad2cf9e96e 100644 --- a/plugins/git4idea/src/git4idea/branch/GitRenameBranchOperation.java +++ b/plugins/git4idea/src/git4idea/branch/GitRenameBranchOperation.java @@ -36,7 +36,7 @@ public class GitRenameBranchOperation extends GitBranchOperation { @NotNull GitBranchUiHandler uiHandler, @NotNull String currentName, @NotNull String newName, - @NotNull List repositories) { + @NotNull List repositories) { super(project, git, uiHandler, repositories); myCurrentName = currentName; myNewName = newName; diff --git a/plugins/git4idea/src/git4idea/branch/GitSmartOperationDialog.java b/plugins/git4idea/src/git4idea/branch/GitSmartOperationDialog.java index a17aa74f0407..28e58afa8338 100644 --- a/plugins/git4idea/src/git4idea/branch/GitSmartOperationDialog.java +++ b/plugins/git4idea/src/git4idea/branch/GitSmartOperationDialog.java @@ -72,7 +72,7 @@ public class GitSmartOperationDialog extends DialogWrapper { */ @NotNull static Choice show(@NotNull Project project, - @NotNull List changes, + @NotNull List changes, @NotNull Collection paths, @NotNull String operationTitle, @Nullable String forceButtonTitle) { diff --git a/plugins/git4idea/src/git4idea/branch/ShowDiffWithBranchDialog.kt b/plugins/git4idea/src/git4idea/branch/ShowDiffWithBranchDialog.kt index da3eed16be14..c35f8f296bb5 100644 --- a/plugins/git4idea/src/git4idea/branch/ShowDiffWithBranchDialog.kt +++ b/plugins/git4idea/src/git4idea/branch/ShowDiffWithBranchDialog.kt @@ -17,7 +17,7 @@ import javax.swing.JComponent internal class ShowDiffWithBranchDialog(val project: Project, val branchName: String, - val repositories: MutableList, + val repositories: List, val currentBranchName: String) : DialogWrapper(project, true) { init { diff --git a/plugins/git4idea/src/git4idea/changes/GitChangeUtils.java b/plugins/git4idea/src/git4idea/changes/GitChangeUtils.java index 00bc459f9637..acf35d0a79cd 100644 --- a/plugins/git4idea/src/git4idea/changes/GitChangeUtils.java +++ b/plugins/git4idea/src/git4idea/changes/GitChangeUtils.java @@ -63,7 +63,7 @@ public class GitChangeUtils { @Nullable GitRevisionNumber thisRevision, GitRevisionNumber parentRevision, String s, - Collection changes, + Collection changes, final Set ignoreNames) throws VcsException { StringScanner sc = new StringScanner(s); parseChanges(project, vcsRoot, thisRevision, parentRevision, sc, changes, ignoreNames); @@ -89,7 +89,7 @@ public class GitChangeUtils { @Nullable GitRevisionNumber thisRevision, @Nullable GitRevisionNumber parentRevision, StringScanner s, - Collection changes, + Collection changes, final Set ignoreNames) throws VcsException { while (s.hasMoreData()) { FileStatus status = null; @@ -220,7 +220,7 @@ public class GitChangeUtils { @Nullable public static Hash commitExists(final Project project, final VirtualFile root, final String anyReference, - List paths, final String... parameters) { + List paths, final String... parameters) { GitLineHandler h = new GitLineHandler(project, root, GitCommand.LOG); h.setSilent(true); h.addParameters(parameters); @@ -324,7 +324,7 @@ public class GitChangeUtils { @NotNull VirtualFile root, @Nullable String oldRevision, @Nullable String newRevision, - @Nullable Collection dirtyPaths) throws VcsException { + @Nullable Collection dirtyPaths) throws VcsException { return getDiff(project, root, oldRevision, newRevision, dirtyPaths, true); } @@ -333,7 +333,7 @@ public class GitChangeUtils { @NotNull VirtualFile root, @Nullable String oldRevision, @Nullable String newRevision, - @Nullable Collection dirtyPaths, + @Nullable Collection dirtyPaths, boolean detectRenames) throws VcsException { LOG.assertTrue(oldRevision != null || newRevision != null, "Both old and new revisions can't be null"); String range; @@ -419,7 +419,7 @@ public class GitChangeUtils { public static Collection getDiffWithWorkingDir(@NotNull Project project, @NotNull VirtualFile root, @NotNull String oldRevision, - @Nullable Collection dirtyPaths, + @Nullable Collection dirtyPaths, boolean reverse) throws VcsException { return getDiffWithWorkingDir(project, root, oldRevision, dirtyPaths, reverse, true); } @@ -428,7 +428,7 @@ public class GitChangeUtils { public static Collection getDiffWithWorkingDir(@NotNull Project project, @NotNull VirtualFile root, @NotNull String oldRevision, - @Nullable Collection dirtyPaths, + @Nullable Collection dirtyPaths, boolean reverse, boolean detectRenames) throws VcsException { String output = getDiffOutput(project, root, oldRevision, dirtyPaths, reverse, detectRenames); @@ -453,7 +453,7 @@ public class GitChangeUtils { private static String getDiffOutput(@NotNull Project project, @NotNull VirtualFile root, @NotNull String diffRange, - @Nullable Collection dirtyPaths, + @Nullable Collection dirtyPaths, boolean reverse, boolean detectRenames) throws VcsException { @@ -470,7 +470,7 @@ public class GitChangeUtils { private static GitLineHandler getDiffHandler(@NotNull Project project, @NotNull VirtualFile root, @NotNull String diffRange, - @Nullable Collection dirtyPaths, + @Nullable Collection dirtyPaths, boolean reverse, boolean detectRenames) { GitLineHandler handler = new GitLineHandler(project, root, GitCommand.DIFF); diff --git a/plugins/git4idea/src/git4idea/changes/GitCommittedChangeListProvider.java b/plugins/git4idea/src/git4idea/changes/GitCommittedChangeListProvider.java index 2108012a9d7f..067c0bd8381d 100644 --- a/plugins/git4idea/src/git4idea/changes/GitCommittedChangeListProvider.java +++ b/plugins/git4idea/src/git4idea/changes/GitCommittedChangeListProvider.java @@ -27,7 +27,6 @@ import com.intellij.vcsUtil.VcsUtil; import git4idea.*; import git4idea.history.GitFileHistory; import git4idea.history.GitHistoryUtils; -import git4idea.history.GitLogUtil; import git4idea.repo.GitRepository; import git4idea.repo.GitRepositoryManager; import org.jetbrains.annotations.NotNull; @@ -84,7 +83,7 @@ public class GitCommittedChangeListProvider implements CommittedChangesProvider< @Override public void loadCommittedChanges(ChangeBrowserSettings settings, RepositoryLocation location, int maxCount, - final AsynchConsumer consumer) throws VcsException { + final AsynchConsumer consumer) throws VcsException { try { getCommittedChangesImpl(settings, location, maxCount, gitCommittedChangeList -> consumer.consume(gitCommittedChangeList)); } @@ -105,7 +104,7 @@ public class GitCommittedChangeListProvider implements CommittedChangesProvider< } private void getCommittedChangesImpl(ChangeBrowserSettings settings, RepositoryLocation location, final int maxCount, - final Consumer consumer) + final Consumer consumer) throws VcsException { GitRepositoryLocation l = (GitRepositoryLocation)location; final Long beforeRev = settings.getChangeBeforeFilter(); diff --git a/plugins/git4idea/src/git4idea/changes/GitOutgoingChangesProvider.java b/plugins/git4idea/src/git4idea/changes/GitOutgoingChangesProvider.java index a151c7763313..14e09e58a811 100644 --- a/plugins/git4idea/src/git4idea/changes/GitOutgoingChangesProvider.java +++ b/plugins/git4idea/src/git4idea/changes/GitOutgoingChangesProvider.java @@ -73,7 +73,7 @@ public class GitOutgoingChangesProvider implements VcsOutgoingChangesProvider filterLocalChangesBasedOnLocalCommits(final Collection localChanges, final VirtualFile vcsRoot) + public Collection filterLocalChangesBasedOnLocalCommits(final Collection localChanges, final VirtualFile vcsRoot) throws VcsException { final GitBranchesSearcher searcher = new GitBranchesSearcher(myProject, vcsRoot, true); if (searcher.getLocal() == null || searcher.getRemote() == null) { diff --git a/plugins/git4idea/src/git4idea/checkin/GitCheckinEnvironment.java b/plugins/git4idea/src/git4idea/checkin/GitCheckinEnvironment.java index d342d39bbabd..62ae963f1c62 100644 --- a/plugins/git4idea/src/git4idea/checkin/GitCheckinEnvironment.java +++ b/plugins/git4idea/src/git4idea/checkin/GitCheckinEnvironment.java @@ -562,10 +562,10 @@ public class GitCheckinEnvironment implements CheckinEnvironment, AmendCommitAwa return files; } - private static void processExcludedPaths(@NotNull Collection changes, + private static void processExcludedPaths(@NotNull Collection changes, @NotNull Set added, @NotNull Set removed, - @NotNull PairConsumer function) { + @NotNull PairConsumer function) { for (Change change : changes) { FilePath before = getBeforePath(change); FilePath after = getAfterPath(change); @@ -946,7 +946,7 @@ public class GitCheckinEnvironment implements CheckinEnvironment, AmendCommitAwa */ private static boolean updateIndex(final Project project, final VirtualFile root, - final Collection added, + final Collection added, final Collection removed, final List exceptions) { boolean rc = true; diff --git a/plugins/git4idea/src/git4idea/checkin/GitCheckinHandlerFactory.java b/plugins/git4idea/src/git4idea/checkin/GitCheckinHandlerFactory.java index 132948bb9010..b29344068353 100644 --- a/plugins/git4idea/src/git4idea/checkin/GitCheckinHandlerFactory.java +++ b/plugins/git4idea/src/git4idea/checkin/GitCheckinHandlerFactory.java @@ -199,7 +199,7 @@ public class GitCheckinHandlerFactory extends VcsCheckinHandlerFactory { @NotNull private static Map> getDefinedUserNames(@NotNull final Project project, - @NotNull final Collection roots, + @NotNull final Collection roots, final boolean stopWhenFoundFirst) { final Map> defined = new HashMap<>(); ProgressManager.getInstance().run(new Task.Modal(project, "Checking Git User Name...", true) { @@ -228,7 +228,7 @@ public class GitCheckinHandlerFactory extends VcsCheckinHandlerFactory { } private boolean setUserNameUnderProgress(@NotNull final Project project, - @NotNull final Collection notDefined, + @NotNull final Collection notDefined, @NotNull final GitUserNameNotDefinedDialog dialog) { final Ref error = Ref.create(); ProgressManager.getInstance().run(new Task.Modal(project, "Setting Git User Name...", true) { diff --git a/plugins/git4idea/src/git4idea/commands/Git.java b/plugins/git4idea/src/git4idea/commands/Git.java index 0157de0f30ee..a744da5acf96 100644 --- a/plugins/git4idea/src/git4idea/commands/Git.java +++ b/plugins/git4idea/src/git4idea/commands/Git.java @@ -48,7 +48,7 @@ public interface Git { * make sure to supply a stateless constructor. */ @NotNull - GitCommandResult runCommand(@NotNull Computable handlerConstructor); + GitCommandResult runCommand(@NotNull Computable handlerConstructor); /** * A generic method to run a Git command, when existing methods are not sufficient.
@@ -72,14 +72,14 @@ public interface Git { GitCommandResult init(@NotNull Project project, @NotNull VirtualFile root, @NotNull GitLineHandlerListener... listeners); @NotNull - Set ignoredFiles(@NotNull Project project, @NotNull VirtualFile root, @Nullable Collection paths) throws VcsException; + Set ignoredFiles(@NotNull Project project, @NotNull VirtualFile root, @Nullable Collection paths) throws VcsException; @NotNull Set ignoredFilesNoChunk(@NotNull Project project, @NotNull VirtualFile root, @Nullable List paths) throws VcsException; @NotNull Set untrackedFiles(@NotNull Project project, @NotNull VirtualFile root, - @Nullable Collection files) throws VcsException; + @Nullable Collection files) throws VcsException; // relativePaths are guaranteed to fit into command line length limitations. @NotNull @@ -182,7 +182,7 @@ public interface Git { @NotNull GitCommandResult checkAttr(@NotNull GitRepository repository, @NotNull Collection attributes, - @NotNull Collection files); + @NotNull Collection files); @NotNull GitCommandResult stashSave(@NotNull GitRepository repository, @NotNull String message); @@ -193,7 +193,7 @@ public interface Git { @NotNull GitCommandResult fetch(@NotNull GitRepository repository, @NotNull GitRemote remote, - @NotNull List listeners, + @NotNull List listeners, String... params); @NotNull diff --git a/plugins/git4idea/src/git4idea/commands/GitHandler.java b/plugins/git4idea/src/git4idea/commands/GitHandler.java index 068da19bdd04..f46c502cb910 100644 --- a/plugins/git4idea/src/git4idea/commands/GitHandler.java +++ b/plugins/git4idea/src/git4idea/commands/GitHandler.java @@ -58,7 +58,7 @@ public abstract class GitHandler { private boolean myStdoutSuppressed; // If true, the standard output is not copied to version control console private boolean myStderrSuppressed; // If true, the standard error is not copied to version control console - @Nullable private ThrowableConsumer myInputProcessor; // The processor for stdin + @Nullable private ThrowableConsumer myInputProcessor; // The processor for stdin private final EventDispatcher myListeners = EventDispatcher.create(ProcessEventListener.class); protected boolean mySilent; // if true, the command execution is not logged in version control view @@ -222,7 +222,7 @@ public abstract class GitHandler { addRelativePaths(Arrays.asList(parameters)); } - public void addRelativePaths(@NotNull Collection filePaths) { + public void addRelativePaths(@NotNull Collection filePaths) { for (FilePath path : filePaths) { if (path instanceof RemoteFilePath) { myCommandLine.addParameter(path.getPath()); @@ -233,7 +233,7 @@ public abstract class GitHandler { } } - public void addRelativeFiles(@NotNull final Collection files) { + public void addRelativeFiles(@NotNull final Collection files) { for (VirtualFile file : files) { myCommandLine.addParameter(VcsFileUtil.relativePath(getWorkingDirectory(), file)); } @@ -342,7 +342,7 @@ public abstract class GitHandler { * * @param inputProcessor the processor */ - public void setInputProcessor(@Nullable ThrowableConsumer inputProcessor) { + public void setInputProcessor(@Nullable ThrowableConsumer inputProcessor) { myInputProcessor = inputProcessor; } diff --git a/plugins/git4idea/src/git4idea/commands/GitHttpGuiAuthenticator.java b/plugins/git4idea/src/git4idea/commands/GitHttpGuiAuthenticator.java index b3c9861c51fc..6e090de0dd09 100644 --- a/plugins/git4idea/src/git4idea/commands/GitHttpGuiAuthenticator.java +++ b/plugins/git4idea/src/git4idea/commands/GitHttpGuiAuthenticator.java @@ -130,7 +130,7 @@ class GitHttpGuiAuthenticator implements GitHttpAuthenticator { } @Nullable - private ProviderAndData acquireData(@NotNull String unifiedUrl, @NotNull Function dataAcquirer) { + private ProviderAndData acquireData(@NotNull String unifiedUrl, @NotNull Function dataAcquirer) { return myAuthenticationGate.waitAndCompute(() -> { try { for (AuthDataProvider provider : getProviders(unifiedUrl)) { diff --git a/plugins/git4idea/src/git4idea/commands/GitImpl.java b/plugins/git4idea/src/git4idea/commands/GitImpl.java index e03f0bdd2dd9..8746e716b663 100644 --- a/plugins/git4idea/src/git4idea/commands/GitImpl.java +++ b/plugins/git4idea/src/git4idea/commands/GitImpl.java @@ -63,7 +63,7 @@ public class GitImpl extends GitImplBase { @NotNull @Override - public Set ignoredFiles(@NotNull Project project, @NotNull VirtualFile root, @Nullable Collection paths) + public Set ignoredFiles(@NotNull Project project, @NotNull VirtualFile root, @Nullable Collection paths) throws VcsException { Set ignoredFiles = new HashSet<>(); @@ -132,7 +132,7 @@ public class GitImpl extends GitImplBase { @Override @NotNull public Set untrackedFiles(@NotNull Project project, @NotNull VirtualFile root, - @Nullable Collection files) throws VcsException { + @Nullable Collection files) throws VcsException { final Set untrackedFiles = new HashSet<>(); if (files == null) { @@ -211,7 +211,7 @@ public class GitImpl extends GitImplBase { @Override public GitCommandResult checkAttr(@NotNull final GitRepository repository, @NotNull final Collection attributes, - @NotNull Collection files) { + @NotNull Collection files) { List relativeFilePaths = ContainerUtil.map(files, file -> VcsFileUtil.relativePath(repository.getRoot(), file)); final GitLineHandler h = new GitLineHandler(repository.getProject(), repository.getRoot(), GitCommand.CHECK_ATTR); @@ -459,7 +459,7 @@ public class GitImpl extends GitImplBase { final boolean force, final boolean updateTracking, final boolean skipHook, - final List forceWithLease, + final List forceWithLease, @Nullable final String tagMode, @NotNull final GitLineHandlerListener... listeners) { return runCommand(() -> { @@ -555,7 +555,7 @@ public class GitImpl extends GitImplBase { @NotNull public GitCommandResult fetch(@NotNull final GitRepository repository, @NotNull final GitRemote remote, - @NotNull final List listeners, + @NotNull final List listeners, final String... params) { return fetch(repository, remote, listeners, null, params); } @@ -563,7 +563,7 @@ public class GitImpl extends GitImplBase { @NotNull public GitCommandResult fetch(@NotNull final GitRepository repository, @NotNull final GitRemote remote, - @NotNull final List listeners, + @NotNull final List listeners, @Nullable GitAuthenticationGate authenticationGate, final String... params) { return runCommand(() -> { @@ -781,7 +781,7 @@ public class GitImpl extends GitImplBase { addListeners(handler, asList(listeners)); } - private static void addListeners(@NotNull GitLineHandler handler, @NotNull List listeners) { + private static void addListeners(@NotNull GitLineHandler handler, @NotNull List listeners) { for (GitLineHandlerListener listener : listeners) { handler.addLineListener(listener); } diff --git a/plugins/git4idea/src/git4idea/commands/GitImplBase.java b/plugins/git4idea/src/git4idea/commands/GitImplBase.java index 75ec47172e05..8ea1588a0af7 100644 --- a/plugins/git4idea/src/git4idea/commands/GitImplBase.java +++ b/plugins/git4idea/src/git4idea/commands/GitImplBase.java @@ -48,7 +48,7 @@ abstract class GitImplBase implements Git { @Override @NotNull - public GitCommandResult runCommand(@NotNull Computable handlerConstructor) { + public GitCommandResult runCommand(@NotNull Computable handlerConstructor) { return run(handlerConstructor, GitImplBase::getCollectingCollector); } @@ -90,8 +90,8 @@ abstract class GitImplBase implements Git { * Run handler with retry on authentication failure */ @NotNull - private GitCommandResult run(@NotNull Computable handlerConstructor, - @NotNull Computable outputCollectorConstructor) { + private GitCommandResult run(@NotNull Computable handlerConstructor, + @NotNull Computable outputCollectorConstructor) { @NotNull GitCommandResult result; int authAttempt = 0; diff --git a/plugins/git4idea/src/git4idea/conflicts/GitMergeHandler.java b/plugins/git4idea/src/git4idea/conflicts/GitMergeHandler.java index 4ce42401904b..6136d29f34fd 100644 --- a/plugins/git4idea/src/git4idea/conflicts/GitMergeHandler.java +++ b/plugins/git4idea/src/git4idea/conflicts/GitMergeHandler.java @@ -66,8 +66,8 @@ public class GitMergeHandler { windowTitle, Arrays.asList(leftTitle, centerTitle, rightTitle)); } - public void acceptOneVersion(@NotNull Collection conflicts, - @NotNull Collection reversedRoots, + public void acceptOneVersion(@NotNull Collection conflicts, + @NotNull Collection reversedRoots, boolean takeTheirs) throws VcsException { try { MultiMap byRoot = groupConflictsByRoot(conflicts); @@ -87,7 +87,7 @@ public class GitMergeHandler { } @NotNull - public static MultiMap groupConflictsByRoot(@NotNull Collection conflicts) { + public static MultiMap groupConflictsByRoot(@NotNull Collection conflicts) { MultiMap byRoot = MultiMap.create(); for (GitConflict conflict : conflicts) { byRoot.putValue(conflict.getRoot(), conflict); diff --git a/plugins/git4idea/src/git4idea/crlf/GitCrlfProblemsDetector.java b/plugins/git4idea/src/git4idea/crlf/GitCrlfProblemsDetector.java index 8d6b1550d3e7..ea7487dc7f51 100644 --- a/plugins/git4idea/src/git4idea/crlf/GitCrlfProblemsDetector.java +++ b/plugins/git4idea/src/git4idea/crlf/GitCrlfProblemsDetector.java @@ -98,7 +98,7 @@ public class GitCrlfProblemsDetector { } @NotNull - private Collection findFilesWithoutAttrs(@NotNull VirtualFile root, @NotNull Collection files) { + private Collection findFilesWithoutAttrs(@NotNull VirtualFile root, @NotNull Collection files) { GitRepository repository = myRepositoryManager.getRepositoryForRoot(root); if (repository == null) { LOG.warn("Repository is null for " + root); @@ -142,7 +142,7 @@ public class GitCrlfProblemsDetector { } @NotNull - private static Collection findFilesWithCrlf(@NotNull Collection files) { + private static Collection findFilesWithCrlf(@NotNull Collection files) { Collection filesWithCrlf = new ArrayList<>(); for (VirtualFile file : files) { ProgressIndicatorProvider.checkCanceled(); diff --git a/plugins/git4idea/src/git4idea/history/GitChangesParser.java b/plugins/git4idea/src/git4idea/history/GitChangesParser.java index 965341dda79b..6b550a2ff35e 100644 --- a/plugins/git4idea/src/git4idea/history/GitChangesParser.java +++ b/plugins/git4idea/src/git4idea/history/GitChangesParser.java @@ -19,7 +19,6 @@ import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.project.Project; import com.intellij.openapi.vcs.FilePath; import com.intellij.openapi.vcs.FileStatus; -import com.intellij.openapi.vcs.VcsException; import com.intellij.openapi.vcs.changes.Change; import com.intellij.openapi.vcs.changes.ContentRevision; import com.intellij.openapi.vcs.history.VcsRevisionNumber; @@ -40,7 +39,7 @@ public class GitChangesParser { @NotNull public static List parse(@NotNull Project project, @NotNull VirtualFile root, - @NotNull List statusInfos, + @NotNull List statusInfos, @NotNull String hash, @NotNull Date date, @Nullable String parentsHash) { @@ -96,7 +95,7 @@ public class GitChangesParser { } @NotNull - public static Change.Type getChangeType(@NotNull GitChangeType type) { + static Change.Type getChangeType(@NotNull GitChangeType type) { switch (type) { case ADDED: return Change.Type.NEW; diff --git a/plugins/git4idea/src/git4idea/history/GitDiffFromHistoryHandler.java b/plugins/git4idea/src/git4idea/history/GitDiffFromHistoryHandler.java index 9bbcadb52f4a..9d0a092d875c 100644 --- a/plugins/git4idea/src/git4idea/history/GitDiffFromHistoryHandler.java +++ b/plugins/git4idea/src/git4idea/history/GitDiffFromHistoryHandler.java @@ -155,8 +155,8 @@ public class GitDiffFromHistoryHandler extends BaseDiffFromHistoryHandler parentHashes, - @Nullable final List revisions, - @NotNull final Consumer resultHandler) { + @Nullable final List revisions, + @NotNull final Consumer resultHandler) { new Task.Backgroundable(myProject, "Loading changes...", true) { private MergeCommitPreCheckInfo myInfo; @@ -187,7 +187,7 @@ public class GitDiffFromHistoryHandler extends BaseDiffFromHistoryHandler findParentRevisions(@NotNull GitRepository repository, @NotNull GitFileRevision currentRevision, @NotNull Collection parentHashes, - @Nullable List revisions) throws VcsException { + @Nullable List revisions) throws VcsException { // currentRevision is a merge revision. // the file could be renamed in one of the branches, i.e. the name in one of the parent revisions may be different from the name // in currentRevision. It can be different even in both parents, but it would a rename-rename conflict, and we don't handle such anyway. @@ -203,7 +203,7 @@ public class GitDiffFromHistoryHandler extends BaseDiffFromHistoryHandler revisions) throws VcsException { + @Nullable List revisions) throws VcsException { if (revisions != null) { for (VcsFileRevision revision : revisions) { if (((GitFileRevision)revision).getHash().equals(parentHash)) { @@ -235,7 +235,7 @@ public class GitDiffFromHistoryHandler extends BaseDiffFromHistoryHandler parents) { + @NotNull Collection parents) { ActionGroup parentActions = createActionGroup(rev, filePath, parents); DataContext dataContext = SimpleDataContext.getProjectContext(myProject); ListPopup popup = JBPopupFactory.getInstance().createActionGroupPopup("Choose parent to compare", parentActions, dataContext, @@ -260,7 +260,7 @@ public class GitDiffFromHistoryHandler extends BaseDiffFromHistoryHandler parents) { + @NotNull Collection parents) { Collection actions = new ArrayList<>(2); for (GitFileRevision parent : parents) { actions.add(createParentAction(rev, filePath, parent)); diff --git a/plugins/git4idea/src/git4idea/history/GitFileHistory.java b/plugins/git4idea/src/git4idea/history/GitFileHistory.java index 1a1f36740095..8a98444b40c9 100644 --- a/plugins/git4idea/src/git4idea/history/GitFileHistory.java +++ b/plugins/git4idea/src/git4idea/history/GitFileHistory.java @@ -87,8 +87,8 @@ public class GitFileHistory { myStartingRevision = revision; } - private void load(@NotNull Consumer consumer, - @NotNull Consumer exceptionConsumer, + private void load(@NotNull Consumer consumer, + @NotNull Consumer exceptionConsumer, String... parameters) { GitLogParser logParser = GitLogParser.createDefaultParser(myProject, GitLogParser.NameStatus.STATUS, HASH, COMMIT_TIME, AUTHOR_NAME, AUTHOR_EMAIL, @@ -198,8 +198,8 @@ public class GitFileHistory { public static void loadHistory(@NotNull Project project, @NotNull FilePath path, @Nullable VcsRevisionNumber startingFrom, - @NotNull Consumer consumer, - @NotNull Consumer exceptionConsumer, + @NotNull Consumer consumer, + @NotNull Consumer exceptionConsumer, String... parameters) { try { VirtualFile repositoryRoot = GitUtil.getRepositoryForFile(project, path).getRoot(); @@ -256,9 +256,9 @@ public class GitFileHistory { @NotNull private final AtomicBoolean mySkipFurtherOutput = new AtomicBoolean(); @NotNull private final AtomicReference myFirstCommit = new AtomicReference<>(); @NotNull private final AtomicReference myCurrentPath = new AtomicReference<>(); - @NotNull private final Consumer myRevisionConsumer; + @NotNull private final Consumer myRevisionConsumer; - GitLogRecordConsumer(@NotNull Consumer revisionConsumer) { + GitLogRecordConsumer(@NotNull Consumer revisionConsumer) { myRevisionConsumer = revisionConsumer; } @@ -276,7 +276,7 @@ public class GitFileHistory { myFirstCommit.set(record.getHash()); myRevisionConsumer.consume(createGitFileRevision(record)); - List statusInfos = record.getStatusInfos(); + List statusInfos = record.getStatusInfos(); if (statusInfos.isEmpty()) { // can safely be empty, for example, for simple merge commits that don't change anything. return; @@ -293,7 +293,7 @@ public class GitFileHistory { Couple authorPair = Couple.of(record.getAuthorName(), record.getAuthorEmail()); Couple committerPair = Couple.of(record.getCommitterName(), record.getCommitterEmail()); Collection parents = Arrays.asList(record.getParentsHashes()); - List statusInfos = record.getStatusInfos(); + List statusInfos = record.getStatusInfos(); boolean deleted = !statusInfos.isEmpty() && statusInfos.get(0).getType() == Change.Type.DELETED; return new GitFileRevision(myProject, myRoot, revisionPath, revision, Couple.of(authorPair, committerPair), record.getFullMessage(), diff --git a/plugins/git4idea/src/git4idea/history/GitHistoryProvider.java b/plugins/git4idea/src/git4idea/history/GitHistoryProvider.java index 4ec4cc7a8224..c5a99625d8ec 100644 --- a/plugins/git4idea/src/git4idea/history/GitHistoryProvider.java +++ b/plugins/git4idea/src/git4idea/history/GitHistoryProvider.java @@ -75,7 +75,7 @@ public class GitHistoryProvider implements VcsHistoryProviderEx, @Override public VcsAbstractHistorySession createFromCachedData(Boolean aBoolean, - @NotNull List revisions, + @NotNull List revisions, @NotNull FilePath filePath, VcsRevisionNumber currentRevision) { return createSession(filePath, revisions, currentRevision); diff --git a/plugins/git4idea/src/git4idea/history/GitLogFullRecord.java b/plugins/git4idea/src/git4idea/history/GitLogFullRecord.java index 9cebb9afbcfa..0b6b11e7a4ef 100644 --- a/plugins/git4idea/src/git4idea/history/GitLogFullRecord.java +++ b/plugins/git4idea/src/git4idea/history/GitLogFullRecord.java @@ -14,10 +14,10 @@ import java.util.*; class GitLogFullRecord extends GitLogRecord { - @NotNull private final List myStatusInfo; + @NotNull private final List myStatusInfo; GitLogFullRecord(@NotNull Map options, - @NotNull List statusInfo, + @NotNull List statusInfo, boolean supportsRawBody) { super(options, supportsRawBody); myStatusInfo = statusInfo; @@ -34,7 +34,7 @@ class GitLogFullRecord extends GitLogRecord { } @NotNull - List getStatusInfos() { + List getStatusInfos() { return myStatusInfo; } diff --git a/plugins/git4idea/src/git4idea/history/GitLogRecordCollector.java b/plugins/git4idea/src/git4idea/history/GitLogRecordCollector.java index c9e370e29dc0..e72def00fa52 100644 --- a/plugins/git4idea/src/git4idea/history/GitLogRecordCollector.java +++ b/plugins/git4idea/src/git4idea/history/GitLogRecordCollector.java @@ -30,14 +30,14 @@ abstract class GitLogRecordCollector implements Consumer @NotNull protected final Project myProject; @NotNull protected final VirtualFile myRoot; - @NotNull protected final Consumer> myConsumer; + @NotNull protected final Consumer> myConsumer; @NotNull private final MultiMap myHashToRecord = MultiMap.createLinked(); @Nullable private String myLastHash = null; protected GitLogRecordCollector(@NotNull Project project, @NotNull VirtualFile root, - @NotNull Consumer> consumer) { + @NotNull Consumer> consumer) { myProject = project; myRoot = root; myConsumer = consumer; @@ -115,7 +115,7 @@ abstract class GitLogRecordCollector implements Consumer @NotNull private static Map getHashToTreeMap(@NotNull Project project, @NotNull VirtualFile root, - @NotNull Collection records) + @NotNull Collection records) throws VcsException { Set hashes = new HashSet<>(); diff --git a/plugins/git4idea/src/git4idea/history/GitLogUnorderedRecordCollector.java b/plugins/git4idea/src/git4idea/history/GitLogUnorderedRecordCollector.java index c0e66091a7b2..e00fdb30bee9 100644 --- a/plugins/git4idea/src/git4idea/history/GitLogUnorderedRecordCollector.java +++ b/plugins/git4idea/src/git4idea/history/GitLogUnorderedRecordCollector.java @@ -36,7 +36,7 @@ class GitLogUnorderedRecordCollector extends GitLogRecordCollector> consumer) { + @NotNull Consumer> consumer) { super(project, root, consumer); } diff --git a/plugins/git4idea/src/git4idea/index/GitIndexUtil.java b/plugins/git4idea/src/git4idea/index/GitIndexUtil.java index 0093ac1df2af..96dfd658c0f7 100644 --- a/plugins/git4idea/src/git4idea/index/GitIndexUtil.java +++ b/plugins/git4idea/src/git4idea/index/GitIndexUtil.java @@ -59,7 +59,7 @@ public class GitIndexUtil { } @NotNull - public static List listStaged(@NotNull GitRepository repository, @NotNull Collection filePaths) throws VcsException { + public static List listStaged(@NotNull GitRepository repository, @NotNull Collection filePaths) throws VcsException { List result = new ArrayList<>(); VirtualFile root = repository.getRoot(); @@ -91,7 +91,7 @@ public class GitIndexUtil { @NotNull public static List listTree(@NotNull GitRepository repository, - @NotNull Collection filePath, + @NotNull Collection filePath, @NotNull VcsRevisionNumber revision) throws VcsException { List result = new ArrayList<>(); VirtualFile root = repository.getRoot(); diff --git a/plugins/git4idea/src/git4idea/log/GitLogDiffHandler.java b/plugins/git4idea/src/git4idea/log/GitLogDiffHandler.java index e51bfe78768e..7facb775dab4 100644 --- a/plugins/git4idea/src/git4idea/log/GitLogDiffHandler.java +++ b/plugins/git4idea/src/git4idea/log/GitLogDiffHandler.java @@ -128,7 +128,7 @@ public class GitLogDiffHandler implements VcsLogDiffHandler { } @NotNull - private static String getTitleForPaths(@NotNull VirtualFile root, @Nullable Collection filePaths) { + private static String getTitleForPaths(@NotNull VirtualFile root, @Nullable Collection filePaths) { if (filePaths == null) return getContentTitle(VcsUtil.getFilePath(root)); String joinedPaths = StringUtil.join(filePaths, path -> VcsFileUtil.relativePath(root, path), ", "); return StringUtil.shortenTextWithEllipsis(joinedPaths, 100, 0); @@ -151,7 +151,7 @@ public class GitLogDiffHandler implements VcsLogDiffHandler { @NotNull private Collection getDiff(@NotNull VirtualFile root, - @NotNull Collection filePaths, + @NotNull Collection filePaths, @NotNull Hash leftRevision, @Nullable Hash rightRevision) throws VcsException { if (rightRevision == null) { @@ -160,8 +160,8 @@ public class GitLogDiffHandler implements VcsLogDiffHandler { return GitChangeUtils.getDiff(myProject, root, leftRevision.asString(), rightRevision.asString(), filePaths); } - private void loadDiffAndShow(@NotNull ThrowableComputable load, - @NotNull Consumer show, + private void loadDiffAndShow(@NotNull ThrowableComputable load, + @NotNull Consumer show, @NotNull @Nls(capitalization = Nls.Capitalization.Title) String title) { if (ApplicationManager.getApplication().isDispatchThread()) { ProgressManager.getInstance().run(new Task.Backgroundable(myProject, title + "...", false) { diff --git a/plugins/git4idea/src/git4idea/log/GitShowExternalLogAction.java b/plugins/git4idea/src/git4idea/log/GitShowExternalLogAction.java index d895e489b743..fd6311367f62 100644 --- a/plugins/git4idea/src/git4idea/log/GitShowExternalLogAction.java +++ b/plugins/git4idea/src/git4idea/log/GitShowExternalLogAction.java @@ -116,12 +116,12 @@ public class GitShowExternalLogAction extends DumbAwareAction { } @NotNull - private static String calcLogId(@NotNull List roots) { + private static String calcLogId(@NotNull List roots) { return EXTERNAL + " " + StringUtil.join(roots, VirtualFile::getPath, File.pathSeparator); } @NotNull - private static String calcTabName(@NotNull ContentManager cm, @NotNull List roots) { + private static String calcTabName(@NotNull ContentManager cm, @NotNull List roots) { String name = VcsLogContentProvider.TAB_NAME + " (" + roots.get(0).getName(); if (roots.size() > 1) { name += "+"; diff --git a/plugins/git4idea/src/git4idea/merge/GitConflictResolver.java b/plugins/git4idea/src/git4idea/merge/GitConflictResolver.java index 70e2eb8483bb..a72669245527 100644 --- a/plugins/git4idea/src/git4idea/merge/GitConflictResolver.java +++ b/plugins/git4idea/src/git4idea/merge/GitConflictResolver.java @@ -39,7 +39,7 @@ public class GitConflictResolver { private static final Logger LOG = Logger.getInstance(GitConflictResolver.class); - @NotNull private final Collection myRoots; + @NotNull private final Collection myRoots; @NotNull private final Params myParams; @NotNull protected final Project myProject; @@ -107,11 +107,11 @@ public class GitConflictResolver { } @Deprecated - public GitConflictResolver(@NotNull Project project, @NotNull Git git, @NotNull Collection roots, @NotNull Params params) { + public GitConflictResolver(@NotNull Project project, @NotNull Git git, @NotNull Collection roots, @NotNull Params params) { this(project, roots, params); } - public GitConflictResolver(@NotNull Project project, @NotNull Collection roots, @NotNull Params params) { + public GitConflictResolver(@NotNull Project project, @NotNull Collection roots, @NotNull Params params) { myProject = project; myRoots = roots; myParams = params; @@ -222,7 +222,7 @@ public class GitConflictResolver { } - private void showMergeDialog(@NotNull Collection initiallyUnmergedFiles) { + private void showMergeDialog(@NotNull Collection initiallyUnmergedFiles) { TransactionGuard.getInstance().assertWriteSafeContext(ModalityState.defaultModalityState()); ApplicationManager.getApplication().invokeAndWait(() -> { MergeProvider mergeProvider = new GitMergeProvider(myProject, myParams.reverse); @@ -243,7 +243,7 @@ public class GitConflictResolver { * @see #getUnmergedFiles(VirtualFile) */ @NotNull - private Collection getUnmergedFiles(@NotNull Collection roots) throws VcsException { + private Collection getUnmergedFiles(@NotNull Collection roots) throws VcsException { final Collection unmergedFiles = new HashSet<>(); for (VirtualFile root : roots) { unmergedFiles.addAll(getUnmergedFiles(root)); diff --git a/plugins/git4idea/src/git4idea/merge/GitMergeCommittingConflictResolver.java b/plugins/git4idea/src/git4idea/merge/GitMergeCommittingConflictResolver.java index 51e8721a928a..a376dc766009 100644 --- a/plugins/git4idea/src/git4idea/merge/GitMergeCommittingConflictResolver.java +++ b/plugins/git4idea/src/git4idea/merge/GitMergeCommittingConflictResolver.java @@ -27,14 +27,14 @@ import java.util.Collection; * Conflict resolver that makes a merge commit after all conflicts are resolved. */ public class GitMergeCommittingConflictResolver extends GitConflictResolver { - private final Collection myMergingRoots; + private final Collection myMergingRoots; private final boolean myRefreshAfterCommit; private final GitMerger myMerger; public GitMergeCommittingConflictResolver(@NotNull Project project, @NotNull Git git, @NotNull GitMerger merger, - @NotNull Collection mergingRoots, + @NotNull Collection mergingRoots, @NotNull Params params, boolean refreshAfterCommit) { super(project, mergingRoots, params); diff --git a/plugins/git4idea/src/git4idea/merge/GitMergeProvider.java b/plugins/git4idea/src/git4idea/merge/GitMergeProvider.java index 44ced9fb60f8..c1015da35356 100644 --- a/plugins/git4idea/src/git4idea/merge/GitMergeProvider.java +++ b/plugins/git4idea/src/git4idea/merge/GitMergeProvider.java @@ -232,7 +232,7 @@ public class GitMergeProvider implements MergeProvider2 { } @Override - public void conflictResolvedForFiles(@NotNull List files, @NotNull Resolution resolution) { + public void conflictResolvedForFiles(@NotNull List files, @NotNull Resolution resolution) { MultiMap byRoot = groupConflictsByRoot(files); for (VirtualFile root : byRoot.keySet()) { @@ -250,7 +250,7 @@ public class GitMergeProvider implements MergeProvider2 { } @Override - public void acceptFilesRevisions(@NotNull List files, @NotNull Resolution resolution) throws VcsException { + public void acceptFilesRevisions(@NotNull List files, @NotNull Resolution resolution) throws VcsException { assert resolution == Resolution.AcceptedYours || resolution == Resolution.AcceptedTheirs; MultiMap byRoot = groupConflictsByRoot(files); @@ -273,7 +273,7 @@ public class GitMergeProvider implements MergeProvider2 { } @NotNull - private MultiMap groupConflictsByRoot(@NotNull List files) { + private MultiMap groupConflictsByRoot(@NotNull List files) { MultiMap byRoot = MultiMap.create(); for (VirtualFile file: files) { GitConflict c = myConflicts.get(file); diff --git a/plugins/git4idea/src/git4idea/merge/GitMergeUtil.java b/plugins/git4idea/src/git4idea/merge/GitMergeUtil.java index 83cdd6b19143..e4c919ed2874 100644 --- a/plugins/git4idea/src/git4idea/merge/GitMergeUtil.java +++ b/plugins/git4idea/src/git4idea/merge/GitMergeUtil.java @@ -411,7 +411,7 @@ public class GitMergeUtil { public static void acceptOneVersion(@NotNull Project project, @NotNull VirtualFile root, - @NotNull Collection conflicts, + @NotNull Collection conflicts, @NotNull GitConflict.ConflictSide side) throws VcsException { boolean isCurrent = side == GitConflict.ConflictSide.OURS; @@ -446,7 +446,7 @@ public class GitMergeUtil { */ public static void markConflictResolved(@NotNull Project project, @NotNull VirtualFile root, - @NotNull Collection conflicts, + @NotNull Collection conflicts, @Nullable GitConflict.ConflictSide side) throws VcsException { List toAdd = new ArrayList<>(); List toDelete = new ArrayList<>(); diff --git a/plugins/git4idea/src/git4idea/merge/GitMerger.java b/plugins/git4idea/src/git4idea/merge/GitMerger.java index a73121d34f7f..6eefba819753 100644 --- a/plugins/git4idea/src/git4idea/merge/GitMerger.java +++ b/plugins/git4idea/src/git4idea/merge/GitMerger.java @@ -51,7 +51,7 @@ public class GitMerger { repository -> repository.getState() == Repository.State.MERGING)); } - public void mergeCommit(@NotNull Collection roots) throws VcsException { + public void mergeCommit(@NotNull Collection roots) throws VcsException { for (VirtualFile root : roots) { mergeCommit(root); } diff --git a/plugins/git4idea/src/git4idea/merge/MergeChangeCollector.java b/plugins/git4idea/src/git4idea/merge/MergeChangeCollector.java index 8437baabe1e2..63be3a5dae65 100644 --- a/plugins/git4idea/src/git4idea/merge/MergeChangeCollector.java +++ b/plugins/git4idea/src/git4idea/merge/MergeChangeCollector.java @@ -60,7 +60,7 @@ public class MergeChangeCollector { /** * Collects changed files during or after merge operation to the supplied {@code updates} container. */ - public void collect(final UpdatedFiles updates, List exceptions) { + public void collect(final UpdatedFiles updates, List exceptions) { try { // collect unmerged Set paths = getUnmergedPaths(); @@ -154,7 +154,7 @@ public class MergeChangeCollector { * Populates the supplied collections of modified, created and removed files returned by 'git diff #revisions' command, * where revisions is the range of revisions to check. */ - public void getChangedFilesExceptUnmerged(Collection updated, Collection created, Collection removed, String revisions) + public void getChangedFilesExceptUnmerged(Collection updated, Collection created, Collection removed, String revisions) throws VcsException { if (revisions == null) { return; diff --git a/plugins/git4idea/src/git4idea/push/GitPushOperation.java b/plugins/git4idea/src/git4idea/push/GitPushOperation.java index f1c8b2083494..a954a6b3ab7e 100644 --- a/plugins/git4idea/src/git4idea/push/GitPushOperation.java +++ b/plugins/git4idea/src/git4idea/push/GitPushOperation.java @@ -199,7 +199,7 @@ public class GitPushOperation { } @NotNull - private Collection findRootsWithMergeCommits(@NotNull Collection rootsToSearch) { + private Collection findRootsWithMergeCommits(@NotNull Collection rootsToSearch) { return ContainerUtil.mapNotNull(rootsToSearch, repo -> { PushSpec pushSpec = myPushSpecs.get(repo); if (pushSpec == null) { // repository is not selected to be pushed, but can be rebased @@ -271,7 +271,7 @@ public class GitPushOperation { } @NotNull - private Map push(@NotNull List repositories) { + private Map push(@NotNull List repositories) { Map results = new LinkedHashMap<>(); for (GitRepository repository : repositories) { PushSpec spec = myPushSpecs.get(repository); @@ -313,7 +313,7 @@ public class GitPushOperation { } @Nullable - private static GitPushNativeResult getBranchResult(@NotNull List results) { + private static GitPushNativeResult getBranchResult(@NotNull List results) { return ContainerUtil.find(results, result -> result.getSourceRef().startsWith("refs/heads/")); } @@ -400,7 +400,7 @@ public class GitPushOperation { } @Nullable - private PushUpdateSettings showDialogAndGetExitCode(@NotNull final Set repositories, + private PushUpdateSettings showDialogAndGetExitCode(@NotNull final Set repositories, @NotNull final PushUpdateSettings initialSettings, final boolean rebaseOverMergeProblemDetected) { Ref updateSettings = Ref.create(); @@ -427,7 +427,7 @@ public class GitPushOperation { } @NotNull - protected GitUpdateResult update(@NotNull Collection rootsToUpdate, + protected GitUpdateResult update(@NotNull Collection rootsToUpdate, @NotNull UpdateMethod updateMethod, boolean checkForRebaseOverMergeProblem) { GitUpdateProcess updateProcess = new GitUpdateProcess(myProject, myProgressIndicator, diff --git a/plugins/git4idea/src/git4idea/rebase/GitAbortRebaseProcess.java b/plugins/git4idea/src/git4idea/rebase/GitAbortRebaseProcess.java index ccb5c3675c79..f4a9afb95cff 100644 --- a/plugins/git4idea/src/git4idea/rebase/GitAbortRebaseProcess.java +++ b/plugins/git4idea/src/git4idea/rebase/GitAbortRebaseProcess.java @@ -191,7 +191,7 @@ class GitAbortRebaseProcess { }).execute(); } - private static void refresh(@NotNull List toRefresh) { + private static void refresh(@NotNull List toRefresh) { for (GitRepository repository : toRefresh) { repository.update(); } diff --git a/plugins/git4idea/src/git4idea/rebase/GitInteractiveRebaseFile.java b/plugins/git4idea/src/git4idea/rebase/GitInteractiveRebaseFile.java index 337e72336e83..89f6f0e5bfce 100644 --- a/plugins/git4idea/src/git4idea/rebase/GitInteractiveRebaseFile.java +++ b/plugins/git4idea/src/git4idea/rebase/GitInteractiveRebaseFile.java @@ -69,7 +69,7 @@ class GitInteractiveRebaseFile { } } - public void save(@NotNull List entries) throws IOException { + public void save(@NotNull List entries) throws IOException { String encoding = GitConfigUtil.getLogEncoding(myProject, myRoot); try (PrintWriter out = new PrintWriter(new OutputStreamWriter(new FileOutputStream(myFile), encoding))) { for (GitRebaseEntry e : entries) { diff --git a/plugins/git4idea/src/git4idea/rebase/GitRebaseProcess.java b/plugins/git4idea/src/git4idea/rebase/GitRebaseProcess.java index 01bcdfb22ba4..2d1693b0f514 100644 --- a/plugins/git4idea/src/git4idea/rebase/GitRebaseProcess.java +++ b/plugins/git4idea/src/git4idea/rebase/GitRebaseProcess.java @@ -347,7 +347,7 @@ public class GitRebaseProcess { ((GitSuccessfulRebase)rebaseStatus).getSuccessType() != SuccessType.UP_TO_DATE; } - private boolean saveDirtyRootsInitially(@NotNull List repositories) { + private boolean saveDirtyRootsInitially(@NotNull List repositories) { Collection repositoriesToSave = filter(repositories, repository -> { return !repository.equals(myRebaseSpec.getOngoingRebase()); // no need to save anything when --continue/--skip is to be called }); @@ -362,7 +362,7 @@ public class GitRebaseProcess { } @Nullable - private String saveLocalChanges(@NotNull Collection rootsToSave) { + private String saveLocalChanges(@NotNull Collection rootsToSave) { try { mySaver.saveLocalChanges(rootsToSave); return null; @@ -393,12 +393,12 @@ public class GitRebaseProcess { } @Nullable - private static String getCommonCurrentBranchNameIfAllTheSame(@NotNull Collection repositories) { + private static String getCommonCurrentBranchNameIfAllTheSame(@NotNull Collection repositories) { return getItemIfAllTheSame(map(repositories, Repository::getCurrentBranchName), null); } @Contract("_, !null -> !null") - private static T getItemIfAllTheSame(@NotNull Collection collection, @Nullable T defaultItem) { + private static T getItemIfAllTheSame(@NotNull Collection collection, @Nullable T defaultItem) { return new HashSet<>(collection).size() == 1 ? getFirstItem(collection) : defaultItem; } diff --git a/plugins/git4idea/src/git4idea/rebase/GitRebaseSpec.java b/plugins/git4idea/src/git4idea/rebase/GitRebaseSpec.java index 7e34180a029b..06dd3050422e 100644 --- a/plugins/git4idea/src/git4idea/rebase/GitRebaseSpec.java +++ b/plugins/git4idea/src/git4idea/rebase/GitRebaseSpec.java @@ -52,7 +52,7 @@ public class GitRebaseSpec { @NotNull public static GitRebaseSpec forNewRebase(@NotNull Project project, @NotNull GitRebaseParams params, - @NotNull Collection repositories, + @NotNull Collection repositories, @NotNull ProgressIndicator indicator) { GitUtil.updateRepositories(repositories); Map initialHeadPositions = findInitialHeadPositions(repositories, params.getBranch()); @@ -147,7 +147,7 @@ public class GitRebaseSpec { } @NotNull - private static Map findInitialHeadPositions(@NotNull Collection repositories, + private static Map findInitialHeadPositions(@NotNull Collection repositories, @Nullable final String branchToCheckout) { return ContainerUtil.map2Map(repositories, repository -> { String currentRevision = findCurrentRevision(repository, branchToCheckout); @@ -177,7 +177,7 @@ public class GitRebaseSpec { } @NotNull - private static Map findInitialBranchNames(@NotNull Collection repositories) { + private static Map findInitialBranchNames(@NotNull Collection repositories) { return ContainerUtil.map2Map(repositories, repository -> { String currentBranchName = repository.getCurrentBranchName(); LOG.debug("Current branch in [" + repository.getRoot().getName() + "] is [" + currentBranchName + "]"); diff --git a/plugins/git4idea/src/git4idea/rebase/GitRebaseUtils.java b/plugins/git4idea/src/git4idea/rebase/GitRebaseUtils.java index 3e31c423cdf7..5420d97cdbc1 100644 --- a/plugins/git4idea/src/git4idea/rebase/GitRebaseUtils.java +++ b/plugins/git4idea/src/git4idea/rebase/GitRebaseUtils.java @@ -44,7 +44,7 @@ public class GitRebaseUtils { } public static void rebase(@NotNull final Project project, - @NotNull final List repositories, + @NotNull final List repositories, @NotNull final GitRebaseParams params, @NotNull final ProgressIndicator indicator) { if (!isRebaseAllowed(project, repositories)) return; // TODO maybe move to the outside @@ -121,7 +121,7 @@ public class GitRebaseUtils { Collections.emptyMap(), indicator, null, true).abortWithConfirmation(); } - private static boolean isRebaseAllowed(@NotNull Project project, @NotNull Collection repositories) { + private static boolean isRebaseAllowed(@NotNull Project project, @NotNull Collection repositories) { // TODO links to 'rebase', 'resolve conflicts', etc. for (GitRepository repository : repositories) { Repository.State state = repository.getState(); diff --git a/plugins/git4idea/src/git4idea/rebase/GitRebaser.java b/plugins/git4idea/src/git4idea/rebase/GitRebaser.java index eecd4c9442f0..d6c36020ed1a 100644 --- a/plugins/git4idea/src/git4idea/rebase/GitRebaser.java +++ b/plugins/git4idea/src/git4idea/rebase/GitRebaser.java @@ -112,7 +112,7 @@ public class GitRebaser { * Runs 'git rebase --continue' on several roots consequently. * @return true if rebase successfully finished. */ - public boolean continueRebase(@NotNull Collection rebasingRoots) { + public boolean continueRebase(@NotNull Collection rebasingRoots) { try (AccessToken ignore = DvcsUtil.workingTreeChangeStarted(myProject, "Rebase")) { boolean success = true; for (VirtualFile root : rebasingRoots) { diff --git a/plugins/git4idea/src/git4idea/repo/GitConfig.java b/plugins/git4idea/src/git4idea/repo/GitConfig.java index 7254ebd62849..089b46d88738 100644 --- a/plugins/git4idea/src/git4idea/repo/GitConfig.java +++ b/plugins/git4idea/src/git4idea/repo/GitConfig.java @@ -45,12 +45,12 @@ public class GitConfig { private static final Pattern BRANCH_INFO_SECTION = Pattern.compile("branch \"(.*)\"", Pattern.CASE_INSENSITIVE); private static final Pattern BRANCH_COMMON_PARAMS_SECTION = Pattern.compile("branch", Pattern.CASE_INSENSITIVE); - @NotNull private final Collection myRemotes; - @NotNull private final Collection myUrls; - @NotNull private final Collection myTrackedInfos; + @NotNull private final Collection myRemotes; + @NotNull private final Collection myUrls; + @NotNull private final Collection myTrackedInfos; - private GitConfig(@NotNull Collection remotes, @NotNull Collection urls, @NotNull Collection trackedInfos) { + private GitConfig(@NotNull Collection remotes, @NotNull Collection urls, @NotNull Collection trackedInfos) { myRemotes = remotes; myUrls = urls; myTrackedInfos = trackedInfos; @@ -76,7 +76,7 @@ public class GitConfig { } @NotNull - private static GitRemote convertRemoteToGitRemote(@NotNull Collection urls, @NotNull Remote remote) { + private static GitRemote convertRemoteToGitRemote(@NotNull Collection urls, @NotNull Remote remote) { UrlsAndPushUrls substitutedUrls = substituteUrls(urls, remote); return new GitRemote(remote.myName, substitutedUrls.getUrls(), substitutedUrls.getPushUrls(), remote.getFetchSpecs(), remote.getPushSpec()); @@ -86,8 +86,8 @@ public class GitConfig { * Create branch tracking information based on the information defined in {@code .git/config}. */ @NotNull - Collection parseTrackInfos(@NotNull final Collection localBranches, - @NotNull final Collection remoteBranches) { + Collection parseTrackInfos(@NotNull final Collection localBranches, + @NotNull final Collection remoteBranches) { return ContainerUtil.mapNotNull(myTrackedInfos, config -> convertBranchConfig(config, localBranches, remoteBranches)); } @@ -137,8 +137,8 @@ public class GitConfig { @Nullable private static GitBranchTrackInfo convertBranchConfig(@Nullable BranchConfig branchConfig, - @NotNull Collection localBranches, - @NotNull Collection remoteBranches) { + @NotNull Collection localBranches, + @NotNull Collection remoteBranches) { if (branchConfig == null) { return null; } @@ -170,7 +170,7 @@ public class GitConfig { } @Nullable - private static GitLocalBranch findLocalBranch(@NotNull String branchName, @NotNull Collection localBranches) { + private static GitLocalBranch findLocalBranch(@NotNull String branchName, @NotNull Collection localBranches) { final String name = GitBranchUtil.stripRefsPrefix(branchName); return ContainerUtil.find(localBranches, input -> input.getName().equals(name)); } @@ -250,7 +250,7 @@ public class GitConfig { *

*/ @NotNull - private static UrlsAndPushUrls substituteUrls(@NotNull Collection urlSections, @NotNull Remote remote) { + private static UrlsAndPushUrls substituteUrls(@NotNull Collection urlSections, @NotNull Remote remote) { List urls = new ArrayList<>(remote.getUrls().size()); Collection pushUrls = new ArrayList<>(); diff --git a/plugins/git4idea/src/git4idea/repo/GitConflictsHolder.java b/plugins/git4idea/src/git4idea/repo/GitConflictsHolder.java index 7e5f76cd8ac0..2fb3e9ae6009 100644 --- a/plugins/git4idea/src/git4idea/repo/GitConflictsHolder.java +++ b/plugins/git4idea/src/git4idea/repo/GitConflictsHolder.java @@ -45,7 +45,7 @@ public class GitConflictsHolder implements Disposable { } } - public void refresh(@NotNull VcsDirtyScope scope, @NotNull Collection conflicts) { + public void refresh(@NotNull VcsDirtyScope scope, @NotNull Collection conflicts) { synchronized (LOCK) { Map map = new HashMap<>(); for (GitConflict conflict : myConflicts) { diff --git a/plugins/git4idea/src/git4idea/repo/GitRepositoryManager.java b/plugins/git4idea/src/git4idea/repo/GitRepositoryManager.java index 50736301e33d..d0fbc3e94a45 100644 --- a/plugins/git4idea/src/git4idea/repo/GitRepositoryManager.java +++ b/plugins/git4idea/src/git4idea/repo/GitRepositoryManager.java @@ -114,7 +114,7 @@ public class GitRepositoryManager extends AbstractRepositoryManagerIf repositories are independent of each other, they are sorted {@link DvcsUtil#REPOSITORY_COMPARATOR by path}.

*/ @NotNull - public List sortByDependency(@NotNull Collection repositories) { + public List sortByDependency(@NotNull Collection repositories) { return ContainerUtil.sorted(repositories, DEPENDENCY_COMPARATOR); } } diff --git a/plugins/git4idea/src/git4idea/repo/GitRepositoryReader.java b/plugins/git4idea/src/git4idea/repo/GitRepositoryReader.java index 8f797d49dd09..26054084442b 100644 --- a/plugins/git4idea/src/git4idea/repo/GitRepositoryReader.java +++ b/plugins/git4idea/src/git4idea/repo/GitRepositoryReader.java @@ -116,7 +116,7 @@ class GitRepositoryReader { @Nullable private GitLocalBranch findCurrentBranch(@NotNull HeadInfo headInfo, @NotNull Repository.State state, - @NotNull Set localBranches) { + @NotNull Set localBranches) { final String currentBranchName = findCurrentBranchName(state, headInfo); if (currentBranchName == null) { return null; diff --git a/plugins/git4idea/src/git4idea/repo/GitUntrackedFilesHolder.java b/plugins/git4idea/src/git4idea/repo/GitUntrackedFilesHolder.java index 25f76fe86c47..68fee6e3a809 100644 --- a/plugins/git4idea/src/git4idea/repo/GitUntrackedFilesHolder.java +++ b/plugins/git4idea/src/git4idea/repo/GitUntrackedFilesHolder.java @@ -144,7 +144,7 @@ public class GitUntrackedFilesHolder implements Disposable, AsyncVfsEventsListen /** * Adds several files to the list of untracked. */ - public void add(@NotNull Collection files) { + public void add(@NotNull Collection files) { synchronized (myDefinitelyUntrackedFiles) { myDefinitelyUntrackedFiles.addAll(files); } diff --git a/plugins/git4idea/src/git4idea/reset/GitResetOperation.java b/plugins/git4idea/src/git4idea/reset/GitResetOperation.java index 669046f7a0d8..62c38c75a7ac 100644 --- a/plugins/git4idea/src/git4idea/reset/GitResetOperation.java +++ b/plugins/git4idea/src/git4idea/reset/GitResetOperation.java @@ -150,7 +150,7 @@ public class GitResetOperation { } @NotNull - private static String joinRepos(@NotNull Collection repositories) { + private static String joinRepos(@NotNull Collection repositories) { return StringUtil.join(DvcsUtil.sortRepositories(repositories), ", "); } diff --git a/plugins/git4idea/src/git4idea/rollback/GitRollbackEnvironment.java b/plugins/git4idea/src/git4idea/rollback/GitRollbackEnvironment.java index 35f6a630de92..3c26aa5cb737 100644 --- a/plugins/git4idea/src/git4idea/rollback/GitRollbackEnvironment.java +++ b/plugins/git4idea/src/git4idea/rollback/GitRollbackEnvironment.java @@ -168,7 +168,7 @@ public class GitRollbackEnvironment implements RollbackEnvironment { * @param files The array of files to revert. * @throws VcsException Id it breaks. */ - public void revert(final VirtualFile root, final List files) throws VcsException { + public void revert(final VirtualFile root, final List files) throws VcsException { for (List paths : VcsFileUtil.chunkPaths(root, files)) { GitLineHandler handler = new GitLineHandler(myProject, root, GitCommand.CHECKOUT); handler.addParameters("HEAD"); @@ -186,7 +186,7 @@ public class GitRollbackEnvironment implements RollbackEnvironment { * @param toUnversioned passed true if the file will be unversioned after unindexing, i.e. it was added before the revert operation. * @throws VcsException if there is a problem with running git */ - private void unindex(final VirtualFile root, final List files, boolean toUnversioned) throws VcsException { + private void unindex(final VirtualFile root, final List files, boolean toUnversioned) throws VcsException { GitFileUtils.deletePaths(myProject, root, files, "--cached", "-f"); if (toUnversioned) { @@ -209,7 +209,7 @@ public class GitRollbackEnvironment implements RollbackEnvironment { * @param file a file to register * @param exceptions the list of exceptions to update */ - private void registerFile(Map> files, FilePath file, List exceptions) { + private void registerFile(Map> files, FilePath file, List exceptions) { try { VirtualFile root = GitUtil.getRepositoryForFile(myProject, file).getRoot(); List paths = files.computeIfAbsent(root, key -> new ArrayList<>()); diff --git a/plugins/git4idea/src/git4idea/stash/GitChangesSaver.java b/plugins/git4idea/src/git4idea/stash/GitChangesSaver.java index e914db76b6a9..3daf8efd3b46 100644 --- a/plugins/git4idea/src/git4idea/stash/GitChangesSaver.java +++ b/plugins/git4idea/src/git4idea/stash/GitChangesSaver.java @@ -77,7 +77,7 @@ public abstract class GitChangesSaver { * Saves local changes in stash or in shelf. * @param rootsToSave Save changes only from these roots. */ - public void saveLocalChanges(@Nullable Collection rootsToSave) throws VcsException { + public void saveLocalChanges(@Nullable Collection rootsToSave) throws VcsException { if (rootsToSave == null || rootsToSave.isEmpty()) { return; } @@ -106,7 +106,7 @@ public abstract class GitChangesSaver { * Saves local changes - specific for chosen save strategy. * @param rootsToSave local changes should be saved on these roots. */ - protected abstract void save(Collection rootsToSave) throws VcsException; + protected abstract void save(Collection rootsToSave) throws VcsException; /** * Loads the changes - specific for chosen save strategy. diff --git a/plugins/git4idea/src/git4idea/stash/GitShelveChangesSaver.java b/plugins/git4idea/src/git4idea/stash/GitShelveChangesSaver.java index 132b0edc8039..a8bd139afe19 100644 --- a/plugins/git4idea/src/git4idea/stash/GitShelveChangesSaver.java +++ b/plugins/git4idea/src/git4idea/stash/GitShelveChangesSaver.java @@ -45,7 +45,7 @@ public class GitShelveChangesSaver extends GitChangesSaver { } @Override - protected void save(@NotNull Collection rootsToSave) throws VcsException { + protected void save(@NotNull Collection rootsToSave) throws VcsException { myVcsShelveChangesSaver.save(rootsToSave); } diff --git a/plugins/git4idea/src/git4idea/stash/GitStashChangesSaver.java b/plugins/git4idea/src/git4idea/stash/GitStashChangesSaver.java index 6899dcf1f001..2276926cfa6b 100644 --- a/plugins/git4idea/src/git4idea/stash/GitStashChangesSaver.java +++ b/plugins/git4idea/src/git4idea/stash/GitStashChangesSaver.java @@ -48,7 +48,7 @@ public class GitStashChangesSaver extends GitChangesSaver { } @Override - protected void save(@NotNull Collection rootsToSave) throws VcsException { + protected void save(@NotNull Collection rootsToSave) throws VcsException { LOG.info("saving " + rootsToSave); for (VirtualFile root : rootsToSave) { @@ -124,10 +124,10 @@ public class GitStashChangesSaver extends GitChangesSaver { private static class UnstashConflictResolver extends GitConflictResolver { - private final Set myStashedRoots; + private final Set myStashedRoots; UnstashConflictResolver(@NotNull Project project, @NotNull Git git, - @NotNull Set stashedRoots, @Nullable Params params) { + @NotNull Set stashedRoots, @Nullable Params params) { super(project, stashedRoots, makeParamsOrUse(params, project)); myStashedRoots = stashedRoots; } diff --git a/plugins/git4idea/src/git4idea/status/GitChangeProvider.java b/plugins/git4idea/src/git4idea/status/GitChangeProvider.java index 3fca13b206ea..8c67447227f3 100644 --- a/plugins/git4idea/src/git4idea/status/GitChangeProvider.java +++ b/plugins/git4idea/src/git4idea/status/GitChangeProvider.java @@ -160,7 +160,7 @@ public class GitChangeProvider implements ChangeProvider { myVcsManager = vcsManager; } - public void changed(final Collection changes) { + public void changed(final Collection changes) { for (Change change : changes) { final FilePath beforePath = ChangesUtil.getBeforePath(change); if (beforePath != null) { diff --git a/plugins/git4idea/src/git4idea/status/GitChangesCollector.java b/plugins/git4idea/src/git4idea/status/GitChangesCollector.java index 18548f3cd831..ec737fd491e7 100644 --- a/plugins/git4idea/src/git4idea/status/GitChangesCollector.java +++ b/plugins/git4idea/src/git4idea/status/GitChangesCollector.java @@ -159,7 +159,7 @@ class GitChangesCollector { return ContainerUtil.map(allPaths, VcsUtil::getFilePath); } - private void addToPaths(FilePath pathToAdd, List paths) { + private void addToPaths(FilePath pathToAdd, List paths) { VcsRoot fileRoot = myVcsManager.getVcsRootObjectFor(pathToAdd); if (fileRoot != null && fileRoot.getVcs() != null && myVcs.equals(fileRoot.getVcs()) && myVcsRoot.equals(fileRoot.getPath())) { paths.add(pathToAdd.getPath()); @@ -183,7 +183,7 @@ class GitChangesCollector { } // calls 'git status' and parses the output, feeding myChanges. - private void collectChanges(Collection dirtyPaths) throws VcsException { + private void collectChanges(Collection dirtyPaths) throws VcsException { GitLineHandler handler = statusHandler(dirtyPaths); String output = myGit.runCommand(handler).getOutputOrThrow(); parseOutput(output, handler); @@ -194,7 +194,7 @@ class GitChangesCollector { myUnversionedFiles.addAll(untrackedFilesHolder.retrieveUntrackedFiles()); } - private GitLineHandler statusHandler(Collection dirtyPaths) { + private GitLineHandler statusHandler(Collection dirtyPaths) { GitLineHandler handler = new GitLineHandler(myProject, myVcsRoot, GitCommand.STATUS); final String[] params = {"--porcelain", "-z", "--untracked-files=no"}; // untracked files are stored separately handler.addParameters(params); diff --git a/plugins/git4idea/src/git4idea/ui/ChangesBrowserWithRollback.java b/plugins/git4idea/src/git4idea/ui/ChangesBrowserWithRollback.java index 5cdbaca5dcc6..687808fb1694 100644 --- a/plugins/git4idea/src/git4idea/ui/ChangesBrowserWithRollback.java +++ b/plugins/git4idea/src/git4idea/ui/ChangesBrowserWithRollback.java @@ -31,7 +31,7 @@ import java.util.Set; public class ChangesBrowserWithRollback extends ChangesBrowserBase implements Disposable { private final Set myOriginalChanges; - public ChangesBrowserWithRollback(@NotNull Project project, @NotNull List changes) { + public ChangesBrowserWithRollback(@NotNull Project project, @NotNull List changes) { super(project, false, true); myOriginalChanges = new HashSet<>(changes); diff --git a/plugins/git4idea/src/git4idea/ui/branch/GitBranchPopupActions.java b/plugins/git4idea/src/git4idea/ui/branch/GitBranchPopupActions.java index ec743de68403..410793b205ea 100644 --- a/plugins/git4idea/src/git4idea/ui/branch/GitBranchPopupActions.java +++ b/plugins/git4idea/src/git4idea/ui/branch/GitBranchPopupActions.java @@ -28,6 +28,7 @@ import com.intellij.openapi.project.DumbAwareAction; import com.intellij.openapi.project.Project; import com.intellij.openapi.ui.Messages; import com.intellij.openapi.util.text.StringUtil; +import com.intellij.util.containers.ContainerUtil; import com.intellij.util.ui.EmptyIcon; import git4idea.GitBranch; import git4idea.GitLocalBranch; @@ -233,10 +234,10 @@ class GitBranchPopupActions { @NotNull private final GitVcsSettings myGitVcsSettings; @NotNull private final GitBranchIncomingOutgoingManager myIncomingOutgoingManager; - LocalBranchActions(@NotNull Project project, @NotNull List repositories, @NotNull String branchName, + LocalBranchActions(@NotNull Project project, @NotNull List repositories, @NotNull String branchName, @NotNull GitRepository selectedRepository) { myProject = project; - myRepositories = repositories; + myRepositories = ContainerUtil.immutableList(repositories); myBranchName = branchName; mySelectedRepository = selectedRepository; myGitBranchManager = ServiceManager.getService(project, GitBranchManager.class); @@ -329,10 +330,10 @@ class GitBranchPopupActions { private static class CheckoutAction extends DumbAwareAction { private final Project myProject; - private final List myRepositories; + private final List myRepositories; private final String myBranchName; - CheckoutAction(@NotNull Project project, @NotNull List repositories, @NotNull String branchName) { + CheckoutAction(@NotNull Project project, @NotNull List repositories, @NotNull String branchName) { super("Checkout"); myProject = project; myRepositories = repositories; @@ -348,10 +349,10 @@ class GitBranchPopupActions { private static class CheckoutAsNewBranch extends DumbAwareAction { private final Project myProject; - private final List myRepositories; + private final List myRepositories; private final String myBranchName; - CheckoutAsNewBranch(@NotNull Project project, @NotNull List repositories, @NotNull String branchName) { + CheckoutAsNewBranch(@NotNull Project project, @NotNull List repositories, @NotNull String branchName) { super("Checkout As..."); myProject = project; myRepositories = repositories; @@ -372,10 +373,10 @@ class GitBranchPopupActions { private static class RenameBranchAction extends DumbAwareAction { @NotNull private final Project myProject; - @NotNull private final List myRepositories; + @NotNull private final List myRepositories; @NotNull private final String myCurrentBranchName; - RenameBranchAction(@NotNull Project project, @NotNull List repositories, @NotNull String currentBranchName) { + RenameBranchAction(@NotNull Project project, @NotNull List repositories, @NotNull String currentBranchName) { super("Rename..."); myProject = project; myRepositories = repositories; @@ -404,10 +405,10 @@ class GitBranchPopupActions { private static class DeleteAction extends DumbAwareAction { private final Project myProject; - private final List myRepositories; + private final List myRepositories; private final String myBranchName; - DeleteAction(Project project, List repositories, String branchName) { + DeleteAction(Project project, List repositories, String branchName) { super("Delete"); myProject = project; myRepositories = repositories; @@ -424,7 +425,7 @@ class GitBranchPopupActions { static class CurrentBranchActions extends LocalBranchActions { CurrentBranchActions(@NotNull Project project, - @NotNull List repositories, + @NotNull List repositories, @NotNull String branchName, @NotNull GitRepository selectedRepository) { super(project, repositories, branchName, selectedRepository); @@ -445,12 +446,12 @@ class GitBranchPopupActions { static class RemoteBranchActions extends BranchActionGroup { private final Project myProject; - private final List myRepositories; + private final List myRepositories; private final String myBranchName; @NotNull private final GitRepository mySelectedRepository; @NotNull private final GitBranchManager myGitBranchManager; - RemoteBranchActions(@NotNull Project project, @NotNull List repositories, @NotNull String branchName, + RemoteBranchActions(@NotNull Project project, @NotNull List repositories, @NotNull String branchName, @NotNull GitRepository selectedRepository) { myProject = project; @@ -486,10 +487,10 @@ class GitBranchPopupActions { private static class CheckoutRemoteBranchAction extends DumbAwareAction { private final Project myProject; - private final List myRepositories; + private final List myRepositories; private final String myRemoteBranchName; - CheckoutRemoteBranchAction(@NotNull Project project, @NotNull List repositories, + CheckoutRemoteBranchAction(@NotNull Project project, @NotNull List repositories, @NotNull String remoteBranchName) { super("Checkout As..."); myProject = project; @@ -517,10 +518,10 @@ class GitBranchPopupActions { private static class RemoteDeleteAction extends DumbAwareAction { private final Project myProject; - private final List myRepositories; + private final List myRepositories; private final String myBranchName; - RemoteDeleteAction(@NotNull Project project, @NotNull List repositories, @NotNull String branchName) { + RemoteDeleteAction(@NotNull Project project, @NotNull List repositories, @NotNull String branchName) { super("Delete"); myProject = project; myRepositories = repositories; @@ -543,12 +544,12 @@ class GitBranchPopupActions { private static class CompareAction extends DumbAwareAction { private final Project myProject; - private final List myRepositories; + private final List myRepositories; private final String myBranchName; private final GitRepository mySelectedRepository; - CompareAction(@NotNull Project project, @NotNull List repositories, @NotNull String branchName, - @NotNull GitRepository selectedRepository) { + CompareAction(@NotNull Project project, @NotNull List repositories, @NotNull String branchName, + @NotNull GitRepository selectedRepository) { super("Compare with Current"); myProject = project; myRepositories = repositories; @@ -576,10 +577,10 @@ class GitBranchPopupActions { private static class ShowDiffWithBranchAction extends DumbAwareAction { private final Project myProject; - private final List myRepositories; + private final List myRepositories; private final String myBranchName; - ShowDiffWithBranchAction(@NotNull Project project, @NotNull List repositories, @NotNull String branchName) { + ShowDiffWithBranchAction(@NotNull Project project, @NotNull List repositories, @NotNull String branchName) { super("Show Diff with Working Tree"); myProject = project; myRepositories = repositories; @@ -601,12 +602,12 @@ class GitBranchPopupActions { private static class MergeAction extends DumbAwareAction { private final Project myProject; - private final List myRepositories; + private final List myRepositories; private final String myBranchName; private final boolean myLocalBranch; - MergeAction(@NotNull Project project, @NotNull List repositories, @NotNull String branchName, - boolean localBranch) { + MergeAction(@NotNull Project project, @NotNull List repositories, @NotNull String branchName, + boolean localBranch) { super("Merge into Current"); myProject = project; myRepositories = repositories; @@ -638,10 +639,10 @@ class GitBranchPopupActions { private static class RebaseAction extends DumbAwareAction { private final Project myProject; - private final List myRepositories; + private final List myRepositories; private final String myBranchName; - RebaseAction(@NotNull Project project, @NotNull List repositories, @NotNull String branchName) { + RebaseAction(@NotNull Project project, @NotNull List repositories, @NotNull String branchName) { super("Rebase Current onto Selected"); myProject = project; myRepositories = repositories; @@ -670,10 +671,10 @@ class GitBranchPopupActions { private static class CheckoutWithRebaseAction extends DumbAwareAction { private final Project myProject; - private final List myRepositories; + private final List myRepositories; private final String myBranchName; - CheckoutWithRebaseAction(@NotNull Project project, @NotNull List repositories, @NotNull String branchName) { + CheckoutWithRebaseAction(@NotNull Project project, @NotNull List repositories, @NotNull String branchName) { super("Checkout and Rebase onto Current"); myProject = project; myRepositories = repositories; @@ -698,11 +699,11 @@ class GitBranchPopupActions { static class TagActions extends BranchActionGroup { private final Project myProject; - private final List myRepositories; + private final List myRepositories; private final String myTagName; private final GitRepository mySelectedRepository; - TagActions(@NotNull Project project, @NotNull List repositories, @NotNull String tagName, + TagActions(@NotNull Project project, @NotNull List repositories, @NotNull String tagName, @NotNull GitRepository selectedRepository) { myProject = project; myRepositories = repositories; @@ -722,10 +723,10 @@ class GitBranchPopupActions { private static class DeleteTagAction extends DumbAwareAction { private final Project myProject; - private final List myRepositories; + private final List myRepositories; private final String myTagName; - DeleteTagAction(Project project, List repositories, String tagName) { + DeleteTagAction(Project project, List repositories, String tagName) { super("Delete"); myProject = project; myRepositories = repositories; @@ -741,7 +742,7 @@ class GitBranchPopupActions { } @NotNull - private static String getCurrentBranchPresentation(@NotNull Collection repositories) { + private static String getCurrentBranchPresentation(@NotNull Collection repositories) { Set currentBranches = map2Set(repositories, repo -> notNull(repo.getCurrentBranchName(), getShortHash(notNull(repo.getCurrentRevision())))); diff --git a/plugins/git4idea/src/git4idea/ui/branch/GitLogBranchOperationsActionGroup.java b/plugins/git4idea/src/git4idea/ui/branch/GitLogBranchOperationsActionGroup.java index 375450ac606e..119b637c64e5 100644 --- a/plugins/git4idea/src/git4idea/ui/branch/GitLogBranchOperationsActionGroup.java +++ b/plugins/git4idea/src/git4idea/ui/branch/GitLogBranchOperationsActionGroup.java @@ -122,7 +122,7 @@ public class GitLogBranchOperationsActionGroup extends GitSingleCommitActionGrou private static AnAction createBranchGroup(@NotNull Project project, @NotNull VcsRef ref, @NotNull GitRepository repository, - @NotNull List allRepositories, + @NotNull List allRepositories, @NotNull Set commonBranches, @NotNull GitVcsSettings settings, boolean showBranchesPopup) { @@ -168,7 +168,7 @@ public class GitLogBranchOperationsActionGroup extends GitSingleCommitActionGrou @NotNull private static ActionGroup createBranchActions(@NotNull Project project, - @NotNull List repositories, + @NotNull List repositories, @NotNull VcsRef ref, @NotNull GitRepository selectedRepository, boolean isLocal) { @@ -182,7 +182,7 @@ public class GitLogBranchOperationsActionGroup extends GitSingleCommitActionGrou @NotNull private static ActionGroup createTagActions(@NotNull Project project, - @NotNull List repositories, + @NotNull List repositories, @NotNull VcsRef ref, @NotNull GitRepository selectedRepository) { return new GitBranchPopupActions.TagActions(project, repositories, ref.getName(), selectedRepository); diff --git a/plugins/git4idea/src/git4idea/ui/branch/GitMultiRootBranchConfig.java b/plugins/git4idea/src/git4idea/ui/branch/GitMultiRootBranchConfig.java index bbcca8b96abf..9e2b8f3bceee 100644 --- a/plugins/git4idea/src/git4idea/ui/branch/GitMultiRootBranchConfig.java +++ b/plugins/git4idea/src/git4idea/ui/branch/GitMultiRootBranchConfig.java @@ -34,7 +34,7 @@ import java.util.Collections; */ public class GitMultiRootBranchConfig extends DvcsMultiRootBranchConfig { - public GitMultiRootBranchConfig(@NotNull Collection repositories) { + public GitMultiRootBranchConfig(@NotNull Collection repositories) { super(repositories); } diff --git a/plugins/git4idea/src/git4idea/ui/branch/GitRefDialog.java b/plugins/git4idea/src/git4idea/ui/branch/GitRefDialog.java index 71ace6503d6c..93fa22ff0f3b 100644 --- a/plugins/git4idea/src/git4idea/ui/branch/GitRefDialog.java +++ b/plugins/git4idea/src/git4idea/ui/branch/GitRefDialog.java @@ -124,7 +124,7 @@ public class GitRefDialog extends DialogWrapper { @NotNull - private static Collection collectCommonVcsRefs(@NotNull Stream stream) { + private static Collection collectCommonVcsRefs(@NotNull Stream stream) { MultiMap map = MultiMap.create(); stream.forEach(ref -> map.putValue(ref.getRoot(), ref)); @@ -134,8 +134,8 @@ public class GitRefDialog extends DialogWrapper { private static class MyVcsRefCompletionProvider extends VcsRefCompletionProvider { MyVcsRefCompletionProvider(@NotNull VcsLogRefs refs, - @NotNull Collection roots, - @NotNull Comparator comparator) { + @NotNull Collection roots, + @NotNull Comparator comparator) { super(refs, roots, new VcsRefDescriptor(comparator)); } @@ -153,11 +153,11 @@ public class GitRefDialog extends DialogWrapper { } private static class MySimpleCompletionListProvider extends TwoStepCompletionProvider { - @NotNull private final List myBranches; - @NotNull private final FutureResult> myTagsFuture; + @NotNull private final List myBranches; + @NotNull private final FutureResult> myTagsFuture; - MySimpleCompletionListProvider(@NotNull List branches, - @NotNull FutureResult> tagsFuture) { + MySimpleCompletionListProvider(@NotNull List branches, + @NotNull FutureResult> tagsFuture) { super(new GitReferenceDescriptor()); myBranches = branches; myTagsFuture = tagsFuture; @@ -184,9 +184,9 @@ public class GitRefDialog extends DialogWrapper { } private static class VcsRefDescriptor extends DefaultTextCompletionValueDescriptor { - @NotNull private final Comparator myReferenceComparator; + @NotNull private final Comparator myReferenceComparator; - private VcsRefDescriptor(@NotNull Comparator comparator) { + private VcsRefDescriptor(@NotNull Comparator comparator) { myReferenceComparator = comparator; } diff --git a/plugins/git4idea/src/git4idea/update/GitFetcher.java b/plugins/git4idea/src/git4idea/update/GitFetcher.java index 99be2eb1b05f..2f46ecda093a 100644 --- a/plugins/git4idea/src/git4idea/update/GitFetcher.java +++ b/plugins/git4idea/src/git4idea/update/GitFetcher.java @@ -254,7 +254,7 @@ public class GitFetcher { * @deprecated Use {@link GitFetchSupport} */ @Deprecated - public boolean fetchRootsAndNotify(@NotNull Collection roots, + public boolean fetchRootsAndNotify(@NotNull Collection roots, @Nullable String errorNotificationTitle, boolean notifySuccess) { MultiRootMessage additionalInfo = new MultiRootMessage(myProject, GitUtil.getRootsFromRepositories(roots), false, true); for (GitRepository repository : roots) { diff --git a/plugins/git4idea/src/git4idea/util/GitFileUtils.java b/plugins/git4idea/src/git4idea/util/GitFileUtils.java index ca5fc105672e..725d97cbee5e 100644 --- a/plugins/git4idea/src/git4idea/util/GitFileUtils.java +++ b/plugins/git4idea/src/git4idea/util/GitFileUtils.java @@ -79,7 +79,7 @@ public class GitFileUtils { Git.getInstance().runCommand(handler).throwOnError(); } - public static void deleteFilesFromCache(@NotNull Project project, @NotNull VirtualFile root, @NotNull Collection files) + public static void deleteFilesFromCache(@NotNull Project project, @NotNull VirtualFile root, @NotNull Collection files) throws VcsException { deleteFiles(project, root, files, "--cached"); updateUntrackedFilesHolderOnFileRemove(project, root, files); @@ -112,7 +112,7 @@ public class GitFileUtils { } private static void updateUntrackedFilesHolderOnFileRemove(@NotNull Project project, @NotNull VirtualFile root, - @NotNull Collection removedFiles) { + @NotNull Collection removedFiles) { GitRepository repository = GitUtil.getRepositoryManager(project).getRepositoryForRoot(root); if (repository == null) { LOG.error("Repository not found for root " + root.getPresentableUrl()); @@ -126,7 +126,7 @@ public class GitFileUtils { } public static void addPaths(@NotNull Project project, @NotNull VirtualFile root, - @NotNull Collection files) throws VcsException { + @NotNull Collection files) throws VcsException { for (List paths : VcsFileUtil.chunkPaths(root, files)) { addPaths(project, root, paths, false); } @@ -134,7 +134,7 @@ public class GitFileUtils { } public static void addPathsForce(@NotNull Project project, @NotNull VirtualFile root, - @NotNull Collection files) throws VcsException { + @NotNull Collection files) throws VcsException { for (List paths : VcsFileUtil.chunkPaths(root, files)) { addPaths(project, root, paths, true); } @@ -142,7 +142,7 @@ public class GitFileUtils { } @NotNull - private static Collection getVirtualFilesFromFilePaths(@NotNull Collection paths) { + private static Collection getVirtualFilesFromFilePaths(@NotNull Collection paths) { Collection files = new ArrayList<>(paths.size()); for (FilePath path : paths) { VirtualFile file = path.getVirtualFile(); diff --git a/plugins/git4idea/src/git4idea/util/GitPreservingExecutor.java b/plugins/git4idea/src/git4idea/util/GitPreservingExecutor.java index 24a93c1672bf..92e4247370ad 100644 --- a/plugins/git4idea/src/git4idea/util/GitPreservingExecutor.java +++ b/plugins/git4idea/src/git4idea/util/GitPreservingExecutor.java @@ -5,7 +5,6 @@ import com.intellij.openapi.progress.ProgressIndicator; import com.intellij.openapi.project.Project; import com.intellij.openapi.vcs.changes.VcsPreservingExecutor; import com.intellij.openapi.vfs.VirtualFile; -import com.intellij.util.ObjectUtils; import com.intellij.util.containers.ContainerUtil; import git4idea.commands.Git; import git4idea.config.GitVcsSettings; @@ -23,7 +22,7 @@ public class GitPreservingExecutor implements VcsPreservingExecutor { @Override public boolean execute(@NotNull Project project, - @NotNull Collection rootsToSave, + @NotNull Collection rootsToSave, @NotNull String operationTitle, @NotNull ProgressIndicator indicator, @NotNull Runnable operation) { @@ -37,7 +36,7 @@ public class GitPreservingExecutor implements VcsPreservingExecutor { return true; } - private static boolean areRootsUnderGitWithInitialCommit(@NotNull Collection roots, + private static boolean areRootsUnderGitWithInitialCommit(@NotNull Collection roots, @NotNull GitRepositoryManager gitRepositoryManager) { return ContainerUtil.all(roots, root -> { GitRepository gitRepository = gitRepositoryManager.getRepositoryForRoot(root); diff --git a/plugins/git4idea/src/git4idea/util/GitPreservingProcess.java b/plugins/git4idea/src/git4idea/util/GitPreservingProcess.java index 879679887f91..a95b318a3995 100644 --- a/plugins/git4idea/src/git4idea/util/GitPreservingProcess.java +++ b/plugins/git4idea/src/git4idea/util/GitPreservingProcess.java @@ -38,7 +38,7 @@ public class GitPreservingProcess { @NotNull private final Project myProject; @NotNull private final Git myGit; - @NotNull private final Collection myRootsToSave; + @NotNull private final Collection myRootsToSave; @NotNull private final String myOperationTitle; @NotNull private final String myDestinationName; @NotNull private final ProgressIndicator myProgressIndicator; @@ -50,7 +50,7 @@ public class GitPreservingProcess { public GitPreservingProcess(@NotNull Project project, @NotNull Git git, - @NotNull Collection rootsToSave, + @NotNull Collection rootsToSave, @NotNull String operationTitle, @NotNull String destinationName, @NotNull GitVcsSettings.UpdateChangesPolicy saveMethod, diff --git a/plugins/git4idea/src/git4idea/util/GitUntrackedFilesHelper.java b/plugins/git4idea/src/git4idea/util/GitUntrackedFilesHelper.java index 56b940a2c1f8..caab0319e0ad 100644 --- a/plugins/git4idea/src/git4idea/util/GitUntrackedFilesHelper.java +++ b/plugins/git4idea/src/git4idea/util/GitUntrackedFilesHelper.java @@ -167,7 +167,7 @@ public class GitUntrackedFilesHelper { private static class UntrackedFilesDialog extends SelectFilesDialog { - UntrackedFilesDialog(Project project, @NotNull Collection untrackedFiles, @NotNull String dialogDesc) { + UntrackedFilesDialog(Project project, @NotNull Collection untrackedFiles, @NotNull String dialogDesc) { super(project, new ArrayList<>(untrackedFiles), StringUtil.stripHtml(dialogDesc, true), null, false, true); init(); } diff --git a/plugins/git4idea/src/git4idea/util/LocalChangesWouldBeOverwrittenHelper.java b/plugins/git4idea/src/git4idea/util/LocalChangesWouldBeOverwrittenHelper.java index 935c7e66bcc9..cd795385ca5f 100644 --- a/plugins/git4idea/src/git4idea/util/LocalChangesWouldBeOverwrittenHelper.java +++ b/plugins/git4idea/src/git4idea/util/LocalChangesWouldBeOverwrittenHelper.java @@ -82,7 +82,7 @@ public class LocalChangesWouldBeOverwrittenHelper { showErrorDialog(project, operationName, changes, absolutePaths); } - private static void showErrorDialog(@NotNull Project project, @NotNull String operationName, @NotNull List changes, + private static void showErrorDialog(@NotNull Project project, @NotNull String operationName, @NotNull List changes, @NotNull Collection absolutePaths) { String title = "Local Changes Prevent from " + StringUtil.capitalize(operationName); String description = getErrorDialogDescription(); diff --git a/plugins/git4idea/src/git4idea/validators/GitNewBranchNameValidator.java b/plugins/git4idea/src/git4idea/validators/GitNewBranchNameValidator.java index 40beb2686f84..49bdc1f9cbea 100644 --- a/plugins/git4idea/src/git4idea/validators/GitNewBranchNameValidator.java +++ b/plugins/git4idea/src/git4idea/validators/GitNewBranchNameValidator.java @@ -39,14 +39,14 @@ import java.util.Collection; */ public final class GitNewBranchNameValidator implements InputValidatorEx { - private final Collection myRepositories; + private final Collection myRepositories; private String myErrorText; - private GitNewBranchNameValidator(@NotNull Collection repositories) { + private GitNewBranchNameValidator(@NotNull Collection repositories) { myRepositories = repositories; } - public static GitNewBranchNameValidator newInstance(@NotNull Collection repositories) { + public static GitNewBranchNameValidator newInstance(@NotNull Collection repositories) { return new GitNewBranchNameValidator(repositories); } diff --git a/plugins/git4idea/src/git4idea/vfs/GitVFSListener.java b/plugins/git4idea/src/git4idea/vfs/GitVFSListener.java index e25aee06db27..6d912aa3f9bf 100644 --- a/plugins/git4idea/src/git4idea/vfs/GitVFSListener.java +++ b/plugins/git4idea/src/git4idea/vfs/GitVFSListener.java @@ -121,10 +121,10 @@ public class GitVFSListener extends VcsVFSListener { performAdding(ObjectsConvertor.vf2fp(new ArrayList<>(addedFiles))); } - private void performAdding(Collection filesToAdd) { + private void performAdding(Collection filesToAdd) { performBackgroundOperation(filesToAdd, GitBundle.getString("add.adding"), new LongOperationPerRootExecutor() { @Override - public void execute(@NotNull VirtualFile root, @NotNull List files) throws VcsException { + public void execute(@NotNull VirtualFile root, @NotNull List files) throws VcsException { executeAdding(root, files); if (!myProject.isDisposed()) { VcsFileUtil.markFilesDirty(myProject, files); @@ -160,7 +160,7 @@ public class GitVFSListener extends VcsVFSListener { final Set filesToRefresh = new HashSet<>(); @Override - public void execute(@NotNull VirtualFile root, @NotNull List files) throws VcsException { + public void execute(@NotNull VirtualFile root, @NotNull List files) throws VcsException { filesToRefresh.addAll(executeDeletion(root, files)); if (!myProject.isDisposed()) { VcsFileUtil.markFilesDirty(myProject, files); @@ -228,13 +228,13 @@ public class GitVFSListener extends VcsVFSListener { }); } - private void executeAdding(@NotNull VirtualFile root, @NotNull List files) + private void executeAdding(@NotNull VirtualFile root, @NotNull List files) throws VcsException { LOG.debug("Git: adding files: " + files); GitFileUtils.addPaths(myProject, root, files); } - private Set executeDeletion(@NotNull VirtualFile root, @NotNull List files) + private Set executeDeletion(@NotNull VirtualFile root, @NotNull List files) throws VcsException { GitFileUtils.deletePaths(myProject, root, files, "--ignore-unmatch", "--cached"); Set filesToRefresh = new HashSet<>(); @@ -249,7 +249,7 @@ public class GitVFSListener extends VcsVFSListener { } private Set executeForceMove(@NotNull VirtualFile root, - @NotNull List files, + @NotNull List files, @NotNull Map filesToMove) { Set toRefresh = new HashSet<>(); for (FilePath file : files) { @@ -276,7 +276,7 @@ public class GitVFSListener extends VcsVFSListener { return deletedFiles; } - private void performBackgroundOperation(@NotNull Collection files, + private void performBackgroundOperation(@NotNull Collection files, @NotNull String operationTitle, @NotNull LongOperationPerRootExecutor executor) { Map> sortedFiles = GitUtil.sortFilePathsByGitRootIgnoringMissing(myProject, files); @@ -298,7 +298,7 @@ public class GitVFSListener extends VcsVFSListener { } private interface LongOperationPerRootExecutor { - void execute(@NotNull VirtualFile root, @NotNull List files) throws VcsException; + void execute(@NotNull VirtualFile root, @NotNull List files) throws VcsException; Collection getFilesToRefresh(); } diff --git a/plugins/git4idea/tests/git4idea/log/GitBranchComparatorTest.java b/plugins/git4idea/tests/git4idea/log/GitBranchComparatorTest.java index c279c12afee8..bf08db7799ce 100644 --- a/plugins/git4idea/tests/git4idea/log/GitBranchComparatorTest.java +++ b/plugins/git4idea/tests/git4idea/log/GitBranchComparatorTest.java @@ -70,13 +70,13 @@ public class GitBranchComparatorTest extends GitRefManagerTest { check("refs/tags/v1", given("refs/tags/v1", "HEAD")); } - private void check(@NotNull String expectedBest, @NotNull Collection givenBranches) { + private void check(@NotNull String expectedBest, @NotNull Collection givenBranches) { VcsRef actualBest = getTheMostPowerfulRef(givenBranches); assertEquals(expect(expectedBest).get(0), actualBest); } @NotNull - private VcsRef getTheMostPowerfulRef(@NotNull Collection givenBranches) { + private VcsRef getTheMostPowerfulRef(@NotNull Collection givenBranches) { Comparator comparator = new GitRefManager(myProject, repositoryManager).getBranchLayoutComparator(); return ContainerUtil.sorted(givenBranches, comparator).get(0); } diff --git a/plugins/git4idea/tests/git4idea/log/GitLabelComparatorTest.java b/plugins/git4idea/tests/git4idea/log/GitLabelComparatorTest.java index d3bbd3251c24..766bd88c6f2f 100644 --- a/plugins/git4idea/tests/git4idea/log/GitLabelComparatorTest.java +++ b/plugins/git4idea/tests/git4idea/log/GitLabelComparatorTest.java @@ -80,7 +80,7 @@ public class GitLabelComparatorTest extends GitRefManagerTest { expect("master", "master")); } - private void check(Collection unsorted, List expected) { + private void check(Collection unsorted, List expected) { // for the sake of simplicity we check only names of references List actual = sort(unsorted); assertEquals("Collections size don't match", expected.size(), actual.size()); @@ -90,7 +90,7 @@ public class GitLabelComparatorTest extends GitRefManagerTest { } @NotNull - private List sort(@NotNull final Collection refs) { + private List sort(@NotNull final Collection refs) { return ContainerUtil.sorted(refs, new GitRefManager(myProject, repositoryManager).getLabelsOrderComparator()); } } diff --git a/plugins/git4idea/tests/git4idea/log/GitRefGroupsTest.java b/plugins/git4idea/tests/git4idea/log/GitRefGroupsTest.java index 84f8830e9679..910f3f8104c5 100644 --- a/plugins/git4idea/tests/git4idea/log/GitRefGroupsTest.java +++ b/plugins/git4idea/tests/git4idea/log/GitRefGroupsTest.java @@ -29,7 +29,7 @@ public class GitRefGroupsTest extends GitRefManagerTest { Pair.create("origin/...", Arrays.asList("origin/master", "origin/remote_branch"))); } - private void check(@NotNull Collection actual, + private void check(@NotNull Collection actual, @NotNull List expectedSingleGroups, Pair>... expectedOtherGroups) { diff --git a/plugins/git4idea/tests/git4idea/log/GitRefManagerTest.java b/plugins/git4idea/tests/git4idea/log/GitRefManagerTest.java index e16036696568..0906aa4764f7 100644 --- a/plugins/git4idea/tests/git4idea/log/GitRefManagerTest.java +++ b/plugins/git4idea/tests/git4idea/log/GitRefManagerTest.java @@ -76,7 +76,7 @@ public abstract class GitRefManagerTest extends GitSingleRepoTest { return new VcsRefImpl(hash, name, type, projectRoot); } - private void setUpTracking(@NotNull Collection refs) { + private void setUpTracking(@NotNull Collection refs) { cd(projectRoot); for (final VcsRef ref : refs) { if (ref.getType() == GitRefManager.LOCAL_BRANCH) { diff --git a/plugins/git4idea/tests/git4idea/repo/GitRepositoryReaderTest.java b/plugins/git4idea/tests/git4idea/repo/GitRepositoryReaderTest.java index 782285e0853d..362dbb98506c 100644 --- a/plugins/git4idea/tests/git4idea/repo/GitRepositoryReaderTest.java +++ b/plugins/git4idea/tests/git4idea/repo/GitRepositoryReaderTest.java @@ -124,7 +124,7 @@ public class GitRepositoryReaderTest extends GitPlatformTest { assertEquals("Incorrect hash of branch " + actual.getName(), expected.hash, hash); } - private static void assertBranches(Map actualBranches, Collection expectedBranches) { + private static void assertBranches(Map actualBranches, Collection expectedBranches) { VcsTestUtil.assertEqualCollections(actualBranches.entrySet(), expectedBranches, new VcsTestUtil.EqualityChecker, Branch>() { @Override public boolean areEqual(Map.Entry actual, Branch expected) { diff --git a/plugins/git4idea/tests/git4idea/test/GitScenarios.java b/plugins/git4idea/tests/git4idea/test/GitScenarios.java index 6bd9a7bfa52c..157475ce5b33 100644 --- a/plugins/git4idea/tests/git4idea/test/GitScenarios.java +++ b/plugins/git4idea/tests/git4idea/test/GitScenarios.java @@ -57,7 +57,7 @@ public class GitScenarios { /** * Create a branch with a commit and return back to master. */ - public static void branchWithCommit(Collection repositories, final String name, final String file, final String content) { + public static void branchWithCommit(Collection repositories, final String name, final String file, final String content) { for (GitRepository repository : repositories) { branchWithCommit(repository, name, file, content); } @@ -66,7 +66,7 @@ public class GitScenarios { /** * Create a branch with a commit and return back to master. */ - public static void branchWithCommit(Collection repositories, String name) { + public static void branchWithCommit(Collection repositories, String name) { GitScenarios.branchWithCommit(repositories, name, "branch_file.txt", "branch content"); } diff --git a/plugins/hg4idea/src/org/zmlx/hg4idea/HgTaskHandler.java b/plugins/hg4idea/src/org/zmlx/hg4idea/HgTaskHandler.java index 35e128cb1d31..9e2e9ed0e27f 100644 --- a/plugins/hg4idea/src/org/zmlx/hg4idea/HgTaskHandler.java +++ b/plugins/hg4idea/src/org/zmlx/hg4idea/HgTaskHandler.java @@ -37,14 +37,14 @@ public class HgTaskHandler extends DvcsTaskHandler { } @Override - protected void checkout(@NotNull String taskName, @NotNull List repos, @Nullable Runnable callInAwtLater) { + protected void checkout(@NotNull String taskName, @NotNull List repos, @Nullable Runnable callInAwtLater) { HgUpdateCommand.updateTo( !HgBranchUtil.getCommonBookmarks(repos).contains(taskName) ? "head() and not bookmark() and branch(\"" + taskName + "\")" : taskName, repos, callInAwtLater); } @Override - protected void checkoutAsNewBranch(@NotNull String name, @NotNull List repositories) { + protected void checkoutAsNewBranch(@NotNull String name, @NotNull List repositories) { HgBookmarkCommand.createBookmarkAsynchronously(repositories, name, true); } @@ -64,7 +64,7 @@ public class HgTaskHandler extends DvcsTaskHandler { } @Override - protected void mergeAndClose(@NotNull final String branch, @NotNull final List repositories) { + protected void mergeAndClose(@NotNull final String branch, @NotNull final List repositories) { String bookmarkRevisionArg = "bookmark(\"" + branch + "\")"; FileDocumentManager.getInstance().saveAllDocuments(); final UpdatedFiles updatedFiles = UpdatedFiles.create(); diff --git a/plugins/hg4idea/src/org/zmlx/hg4idea/provider/HgCommittedChangesProvider.java b/plugins/hg4idea/src/org/zmlx/hg4idea/provider/HgCommittedChangesProvider.java index 988dd14a5ce3..7adfad722925 100644 --- a/plugins/hg4idea/src/org/zmlx/hg4idea/provider/HgCommittedChangesProvider.java +++ b/plugins/hg4idea/src/org/zmlx/hg4idea/provider/HgCommittedChangesProvider.java @@ -83,7 +83,7 @@ public class HgCommittedChangesProvider implements CommittedChangesProvider consumer) { + final AsynchConsumer consumer) { try { List results = getCommittedChanges(changeBrowserSettings, repositoryLocation, maxCount); diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/history/RootsAndBranches.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/history/RootsAndBranches.java index d8a82474a455..766caf1f97a4 100644 --- a/plugins/svn4idea/src/org/jetbrains/idea/svn/history/RootsAndBranches.java +++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/history/RootsAndBranches.java @@ -17,6 +17,7 @@ import com.intellij.openapi.vcs.RepositoryLocation; import com.intellij.openapi.vcs.changes.committed.*; import com.intellij.openapi.vcs.versionBrowser.CommittedChangeList; import com.intellij.ui.ScrollPaneFactory; +import com.intellij.util.containers.ContainerUtil; import com.intellij.util.messages.Topic; import com.intellij.util.ui.JBUI; import icons.SvnIcons; @@ -668,7 +669,7 @@ public class RootsAndBranches implements CommittedChangeListDecorator { } @Override - public void setFilterBase(final List changeLists) { + public void setFilterBase(final List changeLists) { } @Override @@ -686,14 +687,14 @@ public class RootsAndBranches implements CommittedChangeListDecorator { } @Override - public void appendFilterBase(List changeLists) { + public void appendFilterBase(List changeLists) { } @Override @NotNull - public List filterChangeLists(final List changeLists) { + public List filterChangeLists(final List changeLists) { if ((!myFilterAlien.mySelected) && (!myFilterNotMerged.mySelected) && (!myFilterMerged.mySelected)) { - return changeLists; + return ContainerUtil.immutableList(changeLists); } final List result = new ArrayList<>(); diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnCommittedChangesProvider.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnCommittedChangesProvider.java index cce341b0d298..272f06a3c6ae 100644 --- a/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnCommittedChangesProvider.java +++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnCommittedChangesProvider.java @@ -97,7 +97,7 @@ public class SvnCommittedChangesProvider implements CachingCommittedChangesProvi public void loadCommittedChanges(@NotNull ChangeBrowserSettings settings, @NotNull RepositoryLocation location, int maxCount, - @NotNull AsynchConsumer consumer) throws VcsException { + @NotNull AsynchConsumer consumer) throws VcsException { try { SvnRepositoryLocation svnLocation = (SvnRepositoryLocation)location; Url repositoryRoot = getRepositoryRoot(svnLocation); diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnHistoryProvider.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnHistoryProvider.java index de7449aec06e..36ac1c352df0 100644 --- a/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnHistoryProvider.java +++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnHistoryProvider.java @@ -163,7 +163,7 @@ public class SvnHistoryProvider implements VcsHistoryProvider, VcsCacheableHisto @Override public SvnHistorySession createFromCachedData(Boolean aBoolean, - @NotNull List revisions, + @NotNull List revisions, @NotNull FilePath filePath, VcsRevisionNumber currentRevision) { return new SvnHistorySession(myVcs, revisions, filePath, aBoolean, currentRevision, false, ! filePath.isNonLocal()); diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnHistorySession.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnHistorySession.java index 37201b8486b0..f1d401266e08 100644 --- a/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnHistorySession.java +++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnHistorySession.java @@ -18,7 +18,7 @@ public class SvnHistorySession extends VcsAbstractHistorySession { private final boolean myHaveMergeSources; private final boolean myHasLocalSource; - public SvnHistorySession(SvnVcs vcs, final List revisions, final FilePath committedPath, final boolean haveMergeSources, + public SvnHistorySession(SvnVcs vcs, final List revisions, final FilePath committedPath, final boolean haveMergeSources, @Nullable final VcsRevisionNumber currentRevision, boolean skipRefreshOnStart, boolean source) { super(revisions, currentRevision); myVcs = vcs; diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/treeConflict/ApplyPatchSaveToFileExecutor.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/treeConflict/ApplyPatchSaveToFileExecutor.java index b269cf2ff62a..56cfa9499723 100644 --- a/plugins/svn4idea/src/org/jetbrains/idea/svn/treeConflict/ApplyPatchSaveToFileExecutor.java +++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/treeConflict/ApplyPatchSaveToFileExecutor.java @@ -60,7 +60,7 @@ public class ApplyPatchSaveToFileExecutor implements ApplyPatchExecutor patchGroupsToApply, @Nullable LocalChangeList localList, @Nullable String fileName, - @Nullable ThrowableComputable>, PatchSyntaxException> additionalInfo) { + @Nullable ThrowableComputable>, PatchSyntaxException> additionalInfo) { FileSaverDialog dialog = FileChooserFactory.getInstance().createSaveFileDialog(new FileSaverDescriptor("Save Patch to", ""), myProject); VirtualFileWrapper targetFile = dialog.save(myProject.getBaseDir(), "TheirsChanges.patch"); diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/treeConflict/MergeFromTheirsResolver.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/treeConflict/MergeFromTheirsResolver.java index 03e3a239a86d..31973f52265a 100644 --- a/plugins/svn4idea/src/org/jetbrains/idea/svn/treeConflict/MergeFromTheirsResolver.java +++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/treeConflict/MergeFromTheirsResolver.java @@ -180,7 +180,7 @@ public class MergeFromTheirsResolver extends BackgroundTaskGroup { @NotNull MultiMap patchGroupsToApply, @Nullable LocalChangeList localList, @Nullable String fileName, - @Nullable ThrowableComputable>, PatchSyntaxException> additionalInfo) { + @Nullable ThrowableComputable>, PatchSyntaxException> additionalInfo) { List patches = null; VcsException exception = null; try {