diff --git a/plugin/src/main/java/git4idea/commands/GitTask.java b/plugin/src/main/java/git4idea/commands/GitTask.java index 8fec17b..9b6dd0b 100644 --- a/plugin/src/main/java/git4idea/commands/GitTask.java +++ b/plugin/src/main/java/git4idea/commands/GitTask.java @@ -312,7 +312,7 @@ public final void runAlone() { @RequiredUIAccess private void justRun() { - LocalizeValue oldTitle = myProgressIndicator.getTextValue(); + LocalizeValue oldTitle = myProgressIndicator.getText(); myProgressIndicator.setText(myTitle); myDelegate.run(myProgressIndicator); myProgressIndicator.setText(oldTitle); diff --git a/plugin/src/main/java/git4idea/rebase/GitRebaser.java b/plugin/src/main/java/git4idea/rebase/GitRebaser.java index 984d309..c0ff57e 100644 --- a/plugin/src/main/java/git4idea/rebase/GitRebaser.java +++ b/plugin/src/main/java/git4idea/rebase/GitRebaser.java @@ -73,6 +73,7 @@ public GitRebaser(@Nonnull Project project, @Nonnull Git git, @Nonnull ProgressI mySkippedCommits = new ArrayList<>(); } + @RequiredUIAccess public GitUpdateResult rebase( @Nonnull VirtualFile root, @Nonnull List parameters, @@ -95,17 +96,13 @@ public GitUpdateResult rebase( rebaseHandler.addLineListener(GitStandardProgressAnalyzer.createListener(myProgressIndicator)); try (AccessToken ignored = DvcsUtil.workingTreeChangeStarted(myProject, "Rebase")) { - String oldText = myProgressIndicator.getText(); - myProgressIndicator.setText("Rebasing..."); + LocalizeValue oldText = myProgressIndicator.getText(); + myProgressIndicator.setText(LocalizeValue.localizeTODO("Rebasing...")); GitCommandResult result = myGit.runCommand(rebaseHandler); myProgressIndicator.setText(oldText); - return result.success() ? GitUpdateResult.SUCCESS : handleRebaseFailure( - rebaseHandler, - root, - rebaseConflictDetector, - untrackedFilesDetector, - localChangesDetector - ); + return result.success() + ? GitUpdateResult.SUCCESS + : handleRebaseFailure(rebaseHandler, root, rebaseConflictDetector, untrackedFilesDetector, localChangesDetector); } catch (ProcessCanceledException pce) { if (onCancel != null) { diff --git a/plugin/src/main/java/git4idea/stash/GitShelveChangesSaver.java b/plugin/src/main/java/git4idea/stash/GitShelveChangesSaver.java index ab6cc1d..84ead47 100644 --- a/plugin/src/main/java/git4idea/stash/GitShelveChangesSaver.java +++ b/plugin/src/main/java/git4idea/stash/GitShelveChangesSaver.java @@ -57,7 +57,7 @@ protected void save(@Nonnull Collection rootsToSave) throws VcsExce Map>> lists = new LocalChangesUnderRoots(myChangeManager, myVcsManager).getChangesByLists(rootsToSave); - LocalizeValue oldProgressTitle = myProgressIndicator.getTextValue(); + LocalizeValue oldProgressTitle = myProgressIndicator.getText(); myProgressIndicator.setText(GitLocalize.updateShelvingChanges()); List exceptions = new ArrayList<>(1); myShelvedLists = new HashMap<>(); @@ -99,7 +99,7 @@ protected void save(@Nonnull Collection rootsToSave) throws VcsExce public void load() { if (myShelvedLists != null) { LOG.info("load "); - LocalizeValue oldProgressTitle = myProgressIndicator.getTextValue(); + LocalizeValue oldProgressTitle = myProgressIndicator.getText(); myProgressIndicator.setText(GitLocalize.updateUnshelvingChanges()); for (ShelvedChangeList list : myShelvedLists.values()) { GitShelveUtils.doSystemUnshelve( diff --git a/plugin/src/main/java/git4idea/stash/GitStashChangesSaver.java b/plugin/src/main/java/git4idea/stash/GitStashChangesSaver.java index d22dd69..e604c26 100644 --- a/plugin/src/main/java/git4idea/stash/GitStashChangesSaver.java +++ b/plugin/src/main/java/git4idea/stash/GitStashChangesSaver.java @@ -73,7 +73,7 @@ protected void save(@Nonnull Collection rootsToSave) throws VcsExce for (VirtualFile root : rootsToSave) { String message = GitHandlerUtil.formatOperationName("Stashing changes from", root); LOG.info(message); - LocalizeValue oldProgressTitle = myProgressIndicator.getTextValue(); + LocalizeValue oldProgressTitle = myProgressIndicator.getText(); myProgressIndicator.setText(message); GitRepository repository = myRepositoryManager.getRepositoryForRoot(root); if (repository == null) { diff --git a/plugin/src/main/java/git4idea/update/GitMergeUpdater.java b/plugin/src/main/java/git4idea/update/GitMergeUpdater.java index 78cce1c..aa54af6 100644 --- a/plugin/src/main/java/git4idea/update/GitMergeUpdater.java +++ b/plugin/src/main/java/git4idea/update/GitMergeUpdater.java @@ -51,7 +51,6 @@ import java.io.File; import java.util.*; -import static consulo.util.lang.ObjectUtil.assertNotNull; import static java.util.Arrays.asList; /** @@ -86,12 +85,12 @@ protected GitUpdateResult doUpdate() { GitUntrackedFilesOverwrittenByOperationDetector untrackedFilesDetector = new GitUntrackedFilesOverwrittenByOperationDetector(myRoot); - LocalizeValue originalText = myProgressIndicator.getTextValue(); + LocalizeValue originalText = myProgressIndicator.getText(); myProgressIndicator.setText(LocalizeValue.localizeTODO("Merging" + GitUtil.mention(myRepository) + "...")); try { GitCommandResult result = myGit.merge( myRepository, - assertNotNull(myBranchPair.getDest()).getName(), + Objects.requireNonNull(myBranchPair.getDest()).getName(), asList("--no-stat", "-v"), mergeLineListener, untrackedFilesDetector, diff --git a/plugin/src/main/java/git4idea/update/GitUpdateProcess.java b/plugin/src/main/java/git4idea/update/GitUpdateProcess.java index 42800c8..9e53a2f 100644 --- a/plugin/src/main/java/git4idea/update/GitUpdateProcess.java +++ b/plugin/src/main/java/git4idea/update/GitUpdateProcess.java @@ -123,7 +123,7 @@ public GitUpdateProcess( @RequiredUIAccess public GitUpdateResult update(UpdateMethod updateMethod) { LOG.info("update started|" + updateMethod); - LocalizeValue oldText = myProgressIndicator.getTextValue(); + LocalizeValue oldText = myProgressIndicator.getText(); myProgressIndicator.setText(LocalizeValue.localizeTODO("Updating...")); for (GitRepository repository : myRepositories) { @@ -272,7 +272,7 @@ private Collection findRootsRebasingOverMerge(@Nonnull Map