mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
got rid of commons-lang usages in hg4idea
This commit is contained in:
@@ -15,7 +15,6 @@
|
||||
<orderEntry type="module" module-name="platform-api" />
|
||||
<orderEntry type="module" module-name="vcs-impl" />
|
||||
<orderEntry type="module" module-name="platform-impl" />
|
||||
<orderEntry type="library" name="Velocity" level="project" />
|
||||
<orderEntry type="library" name="Guava" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
|
||||
@@ -16,13 +16,13 @@ import com.intellij.notification.Notification;
|
||||
import com.intellij.notification.NotificationType;
|
||||
import com.intellij.notification.Notifications;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.vcsUtil.VcsImplUtil;
|
||||
import com.intellij.vcsUtil.VcsUtil;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.zmlx.hg4idea.util.HgErrorUtil;
|
||||
import org.zmlx.hg4idea.HgVcs;
|
||||
import org.zmlx.hg4idea.execution.HgCommandResult;
|
||||
import org.zmlx.hg4idea.util.HgErrorUtil;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -42,7 +42,7 @@ public final class HgCommandResultNotifier {
|
||||
}
|
||||
if (HgErrorUtil.isAbort(result)) {
|
||||
VcsImplUtil.showErrorMessage(
|
||||
myProject, "<html>" + StringUtils.join(err, "<br>") + "</html>", "Error"
|
||||
myProject, "<html>" + StringUtil.join(err, "<br>") + "</html>", "Error"
|
||||
);
|
||||
} else if (successTitle != null && successDescription != null) {
|
||||
Notifications.Bus.notify(new Notification(HgVcs.NOTIFICATION_GROUP_ID, successTitle, successDescription, NotificationType.INFORMATION), myProject);
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
package org.zmlx.hg4idea.command;
|
||||
|
||||
import com.intellij.openapi.project.Project;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.zmlx.hg4idea.HgFile;
|
||||
import org.zmlx.hg4idea.HgRevisionNumber;
|
||||
@@ -55,7 +55,7 @@ public class HgCatCommand {
|
||||
final List<String> arguments = new LinkedList<String>();
|
||||
if (vcsRevisionNumber != null) {
|
||||
arguments.add("--rev");
|
||||
if (StringUtils.isNotBlank(vcsRevisionNumber.getChangeset())) {
|
||||
if (!StringUtil.isEmptyOrSpaces(vcsRevisionNumber.getChangeset())) {
|
||||
arguments.add(vcsRevisionNumber.getChangeset());
|
||||
} else {
|
||||
arguments.add(vcsRevisionNumber.getRevision());
|
||||
|
||||
@@ -14,8 +14,8 @@ package org.zmlx.hg4idea.command;
|
||||
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.zmlx.hg4idea.HgRevisionNumber;
|
||||
import org.zmlx.hg4idea.execution.HgCommandExecutor;
|
||||
@@ -62,7 +62,7 @@ public abstract class HgChangesetsCommand {
|
||||
}
|
||||
|
||||
String output = result.getRawOutput();
|
||||
if (StringUtils.isEmpty(output)) {
|
||||
if (StringUtil.isEmpty(output)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@@ -70,9 +70,9 @@ public abstract class HgChangesetsCommand {
|
||||
List<HgRevisionNumber> revisions = new ArrayList<HgRevisionNumber>(changesets.length);
|
||||
|
||||
for(String changeset: changesets) {
|
||||
String[] parts = StringUtils.split(changeset, HgChangesetUtil.ITEM_SEPARATOR);
|
||||
if (parts.length == 4) {
|
||||
revisions.add(HgRevisionNumber.getInstance(parts[0], parts[1], parts[2], parts[3]));
|
||||
List<String> parts = StringUtil.split(changeset, HgChangesetUtil.ITEM_SEPARATOR);
|
||||
if (parts.size() == 4) {
|
||||
revisions.add(HgRevisionNumber.getInstance(parts.get(0), parts.get(1), parts.get(2), parts.get(3)));
|
||||
} else {
|
||||
LOG.warn("Could not parse changeset [" + changeset + "]");
|
||||
}
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
package org.zmlx.hg4idea.command;
|
||||
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.zmlx.hg4idea.HgRevisionNumber;
|
||||
|
||||
@@ -47,7 +47,7 @@ public class HgHeadsCommand {
|
||||
|
||||
@Override
|
||||
protected void addArguments(List<String> args) {
|
||||
if (StringUtils.isNotEmpty(branch)) {
|
||||
if (!StringUtil.isEmpty(branch)) {
|
||||
args.add(branch);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
package org.zmlx.hg4idea.command;
|
||||
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.zmlx.hg4idea.HgVcs;
|
||||
import org.zmlx.hg4idea.execution.HgCommandExecutor;
|
||||
@@ -49,10 +49,10 @@ public class HgMergeCommand {
|
||||
HgCommandExecutor commandExecutor = new HgCommandExecutor(project);
|
||||
commandExecutor.setShowOutput(true);
|
||||
List<String> arguments = new LinkedList<String>();
|
||||
if (StringUtils.isNotBlank(revision)) {
|
||||
if (!StringUtil.isEmptyOrSpaces(revision)) {
|
||||
arguments.add("--rev");
|
||||
arguments.add(revision);
|
||||
} else if (StringUtils.isNotBlank(branch)) {
|
||||
} else if (!StringUtil.isEmptyOrSpaces(branch)) {
|
||||
arguments.add(branch);
|
||||
}
|
||||
final HgCommandResult result = commandExecutor.executeInCurrentThread(repo, "merge", arguments);
|
||||
|
||||
@@ -14,8 +14,8 @@ package org.zmlx.hg4idea.command;
|
||||
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.zmlx.hg4idea.HgVcs;
|
||||
import org.zmlx.hg4idea.action.HgCommandResultNotifier;
|
||||
@@ -67,7 +67,7 @@ public class HgPullCommand {
|
||||
arguments.add("--rebase");
|
||||
}
|
||||
|
||||
if (StringUtils.isNotBlank(revision)) {
|
||||
if (!StringUtil.isEmptyOrSpaces(revision)) {
|
||||
arguments.add("--rev");
|
||||
arguments.add(revision);
|
||||
}
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
package org.zmlx.hg4idea.command;
|
||||
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.zmlx.hg4idea.HgVcs;
|
||||
@@ -55,7 +55,7 @@ public class HgPushCommand {
|
||||
|
||||
public void execute(final HgCommandResultHandler resultHandler) {
|
||||
final List<String> arguments = new LinkedList<String>();
|
||||
if (StringUtils.isNotBlank(myRevision)) {
|
||||
if (!StringUtil.isEmptyOrSpaces(myRevision)) {
|
||||
arguments.add("-r");
|
||||
arguments.add(myRevision);
|
||||
}
|
||||
|
||||
@@ -13,10 +13,10 @@
|
||||
package org.zmlx.hg4idea.command;
|
||||
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vcs.FilePath;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.vcsUtil.VcsFileUtil;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.zmlx.hg4idea.HgRevisionNumber;
|
||||
import org.zmlx.hg4idea.HgVcs;
|
||||
import org.zmlx.hg4idea.execution.HgCommandExecutor;
|
||||
@@ -37,7 +37,7 @@ public class HgRevertCommand {
|
||||
final List<String> options = new LinkedList<String>();
|
||||
if (vcsRevisionNumber != null && !HgRevisionNumber.NULL_REVISION_NUMBER.equals(vcsRevisionNumber)) {
|
||||
options.add("--rev");
|
||||
if (StringUtils.isNotBlank(vcsRevisionNumber.getChangeset())) {
|
||||
if (!StringUtil.isEmptyOrSpaces(vcsRevisionNumber.getChangeset())) {
|
||||
options.add(vcsRevisionNumber.getChangeset());
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -14,18 +14,18 @@ package org.zmlx.hg4idea.command;
|
||||
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vcs.FilePath;
|
||||
import com.intellij.openapi.vcs.changes.ChangeListManager;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.zmlx.hg4idea.HgFile;
|
||||
import org.zmlx.hg4idea.HgFileRevision;
|
||||
import org.zmlx.hg4idea.HgRevisionNumber;
|
||||
import org.zmlx.hg4idea.util.HgUtil;
|
||||
import org.zmlx.hg4idea.util.HgChangesetUtil;
|
||||
import org.zmlx.hg4idea.execution.HgCommandResult;
|
||||
import org.zmlx.hg4idea.execution.HgCommandExecutor;
|
||||
import org.zmlx.hg4idea.execution.HgCommandResult;
|
||||
import org.zmlx.hg4idea.util.HgChangesetUtil;
|
||||
import org.zmlx.hg4idea.util.HgUtil;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
@@ -101,7 +101,7 @@ abstract class HgRevisionsCommand {
|
||||
String parentsString = attributes[PARENTS_INDEX];
|
||||
|
||||
List<HgRevisionNumber> parents = new ArrayList<HgRevisionNumber>(2);
|
||||
if (StringUtils.isEmpty(parentsString)) {
|
||||
if (StringUtil.isEmpty(parentsString)) {
|
||||
Long revision = Long.valueOf(revisionString);
|
||||
HgRevisionNumber parentRevision = HgRevisionNumber.getLocalInstance(String.valueOf(revision - 1));
|
||||
parents.add(parentRevision);
|
||||
@@ -161,7 +161,7 @@ abstract class HgRevisionsCommand {
|
||||
}
|
||||
|
||||
private Set<String> parseFileList(String fileListString) {
|
||||
if (StringUtils.isEmpty(fileListString)) {
|
||||
if (StringUtil.isEmpty(fileListString)) {
|
||||
return Collections.emptySet();
|
||||
} else {
|
||||
return new HashSet<String>(Arrays.asList(fileListString.split(" ")));
|
||||
@@ -169,7 +169,7 @@ abstract class HgRevisionsCommand {
|
||||
}
|
||||
|
||||
private Map<String, String> parseCopiesFileList(String fileListString) {
|
||||
if (StringUtils.isEmpty(fileListString)) {
|
||||
if (StringUtil.isEmpty(fileListString)) {
|
||||
return Collections.emptyMap();
|
||||
} else {
|
||||
Map<String, String> copies = new HashMap<String, String>();
|
||||
|
||||
@@ -13,13 +13,14 @@
|
||||
package org.zmlx.hg4idea.command;
|
||||
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.zmlx.hg4idea.execution.HgCommandExecutor;
|
||||
import org.zmlx.hg4idea.execution.HgCommandResult;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class HgShowConfigCommand {
|
||||
@@ -58,9 +59,9 @@ public class HgShowConfigCommand {
|
||||
|
||||
Map<String, String> options = new HashMap<String, String>();
|
||||
for (String line : result.getOutputLines()) {
|
||||
String[] option = StringUtils.splitPreserveAllTokens(line, '=');
|
||||
if (option.length == 2) {
|
||||
options.put(option[0].trim(), option[1].trim());
|
||||
List<String> option = StringUtil.split(line, "=", true, false);
|
||||
if (option.size() == 2) {
|
||||
options.put(option.get(0).trim(), option.get(1).trim());
|
||||
}
|
||||
}
|
||||
return options;
|
||||
|
||||
@@ -15,7 +15,6 @@ package org.zmlx.hg4idea.command;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.util.Consumer;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.zmlx.hg4idea.HgRevisionNumber;
|
||||
@@ -55,7 +54,7 @@ public class HgTagBranchCommand {
|
||||
if (output == null || output.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
return StringUtils.trim(output.get(0));
|
||||
return output.get(0).trim();
|
||||
}
|
||||
|
||||
public void listBranches(final Consumer<List<HgTagBranch>> branchListConsumer) {
|
||||
|
||||
+3
-3
@@ -14,8 +14,8 @@ package org.zmlx.hg4idea.command;
|
||||
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.zmlx.hg4idea.HgFile;
|
||||
import org.zmlx.hg4idea.execution.HgCommandExecutor;
|
||||
import org.zmlx.hg4idea.execution.HgCommandResult;
|
||||
@@ -118,7 +118,7 @@ class HgTrackFileNamesAccrossRevisionsCommand {
|
||||
}
|
||||
|
||||
private Set<String> parseFileList(String fileListString) {
|
||||
if (StringUtils.isEmpty(fileListString)) {
|
||||
if (StringUtil.isEmpty(fileListString)) {
|
||||
return Collections.emptySet();
|
||||
} else {
|
||||
return new HashSet<String>(Arrays.asList(fileListString.split(" ")));
|
||||
@@ -126,7 +126,7 @@ class HgTrackFileNamesAccrossRevisionsCommand {
|
||||
}
|
||||
|
||||
private Map<String, String> parseCopiesFileList(String fileListString) {
|
||||
if (StringUtils.isEmpty(fileListString)) {
|
||||
if (StringUtil.isEmpty(fileListString)) {
|
||||
return Collections.emptyMap();
|
||||
} else {
|
||||
Map<String, String> copies = new HashMap<String, String>();
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
package org.zmlx.hg4idea.command;
|
||||
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.zmlx.hg4idea.HgVcs;
|
||||
@@ -57,10 +57,10 @@ public class HgUpdateCommand {
|
||||
arguments.add("--clean");
|
||||
}
|
||||
|
||||
if (StringUtils.isNotBlank(revision)) {
|
||||
if (!StringUtil.isEmptyOrSpaces(revision)) {
|
||||
arguments.add("--rev");
|
||||
arguments.add(revision);
|
||||
} else if (StringUtils.isNotBlank(branch)) {
|
||||
} else if (!StringUtil.isEmptyOrSpaces(branch)) {
|
||||
arguments.add(branch);
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
// limitations under the License.
|
||||
package org.zmlx.hg4idea.command;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.zmlx.hg4idea.execution.ShellCommand;
|
||||
import org.zmlx.hg4idea.execution.ShellCommandException;
|
||||
|
||||
@@ -22,7 +21,7 @@ import java.util.Arrays;
|
||||
public class HgVersionCommand {
|
||||
|
||||
public boolean isValid(String executable, boolean isRunViaBash) {
|
||||
String hgExecutable = StringUtils.trim(executable);
|
||||
String hgExecutable = executable == null ? null : executable.trim();
|
||||
ShellCommand shellCommand = new ShellCommand(isRunViaBash);
|
||||
try {
|
||||
return !shellCommand
|
||||
|
||||
@@ -15,11 +15,11 @@ package org.zmlx.hg4idea.command;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vcs.FilePath;
|
||||
import com.intellij.openapi.vcs.ObjectsConvertor;
|
||||
import com.intellij.openapi.vcs.changes.ChangeListManager;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.zmlx.hg4idea.HgRevisionNumber;
|
||||
@@ -28,7 +28,10 @@ import org.zmlx.hg4idea.execution.HgCommandResult;
|
||||
import org.zmlx.hg4idea.util.HgChangesetUtil;
|
||||
import org.zmlx.hg4idea.util.HgUtil;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Commands to get revision numbers. These are: parents, id, tip.
|
||||
@@ -142,16 +145,17 @@ public class HgWorkingCopyRevisionsCommand {
|
||||
|
||||
final List<String> lines = result.getOutputLines();
|
||||
if (lines != null && !lines.isEmpty()) {
|
||||
String[] parts = StringUtils.split(lines.get(0), ' ');
|
||||
String changesets = parts[0];
|
||||
String revisions = parts[1];
|
||||
if (parts.length >= 2) {
|
||||
List<String> parts = StringUtil.split(lines.get(0), " ");
|
||||
String changesets = parts.get(0);
|
||||
String revisions = parts.get(1);
|
||||
if (parts.size() >= 2) {
|
||||
if (changesets.indexOf('+') != changesets.lastIndexOf('+')) {
|
||||
// in the case of unresolved merge we have 2 revisions at once, both current, so with "+"
|
||||
// 9f2e6c02913c+b311eb4eb004+ 186+183+
|
||||
String[] chsets = StringUtils.split(changesets, "+");
|
||||
String[] revs = StringUtils.split(revisions, "+");
|
||||
return Pair.create(HgRevisionNumber.getInstance(revs[0] + "+", chsets[0] + "+"), HgRevisionNumber.getInstance(revs[1] + "+", chsets[1] + "+"));
|
||||
List<String> chsets = StringUtil.split(changesets, "+");
|
||||
List<String> revs = StringUtil.split(revisions, "+");
|
||||
return Pair.create(HgRevisionNumber.getInstance(revs.get(0) + "+", chsets.get(0) + "+"),
|
||||
HgRevisionNumber.getInstance(revs.get(1) + "+", chsets.get(1) + "+"));
|
||||
} else {
|
||||
return Pair.create(HgRevisionNumber.getInstance(revisions, changesets), null);
|
||||
}
|
||||
@@ -208,12 +212,12 @@ public class HgWorkingCopyRevisionsCommand {
|
||||
|
||||
final List<HgRevisionNumber> revisions = new ArrayList<HgRevisionNumber>(lines.size());
|
||||
for(String line: lines) {
|
||||
final String[] parts = StringUtils.split(line, HgChangesetUtil.ITEM_SEPARATOR);
|
||||
if (parts.length < 2) {
|
||||
final List<String> parts = StringUtil.split(line, HgChangesetUtil.ITEM_SEPARATOR);
|
||||
if (parts.size() < 2) {
|
||||
LOG.error("getRevisions output parse error in line [" + line + "]\n All lines: \n" + lines);
|
||||
continue;
|
||||
}
|
||||
revisions.add(HgRevisionNumber.getInstance(parts[0], parts[1]));
|
||||
revisions.add(HgRevisionNumber.getInstance(parts.get(0), parts.get(1)));
|
||||
}
|
||||
|
||||
return revisions;
|
||||
|
||||
@@ -16,9 +16,9 @@ import com.intellij.execution.ui.ConsoleViewContentType;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.vcsUtil.VcsImplUtil;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.zmlx.hg4idea.HgGlobalSettings;
|
||||
@@ -186,7 +186,7 @@ public final class HgCommandExecutor {
|
||||
exeName = settings.getHgExecutable().substring(lastSlashIndex + 1);
|
||||
|
||||
final String executable = settings.isRunViaBash() ? "bash -c " + exeName : exeName;
|
||||
final String cmdString = String.format("%s %s %s", executable, operation, arguments == null ? "" : StringUtils.join(arguments, " "));
|
||||
final String cmdString = String.format("%s %s %s", executable, operation, arguments == null ? "" : StringUtil.join(arguments, " "));
|
||||
|
||||
// log command
|
||||
if (!myIsSilent) {
|
||||
|
||||
@@ -14,6 +14,7 @@ package org.zmlx.hg4idea.provider;
|
||||
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vcs.*;
|
||||
import com.intellij.openapi.vcs.actions.VcsContextFactory;
|
||||
import com.intellij.openapi.vcs.changes.Change;
|
||||
@@ -27,7 +28,6 @@ import com.intellij.openapi.vcs.versionBrowser.CommittedChangeList;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.util.AsynchConsumer;
|
||||
import com.intellij.vcsUtil.VcsUtil;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.zmlx.hg4idea.HgContentRevision;
|
||||
@@ -97,7 +97,7 @@ public class HgCachingCommitedChangesProvider
|
||||
String revisionPath = dataInput.readUTF();
|
||||
HgRevisionNumber revisionNumber = readRevisionNumber(dataInput);
|
||||
|
||||
if (!StringUtils.isEmpty(revisionPath)) {
|
||||
if (!StringUtil.isEmpty(revisionPath)) {
|
||||
VirtualFile root = ((HgRepositoryLocation) repositoryLocation).getRoot();
|
||||
return new HgContentRevision(
|
||||
project,
|
||||
|
||||
@@ -18,7 +18,6 @@ import com.intellij.openapi.vcs.annotate.*;
|
||||
import com.intellij.openapi.vcs.changes.CurrentContentRevision;
|
||||
import com.intellij.openapi.vcs.history.VcsFileRevision;
|
||||
import com.intellij.openapi.vcs.history.VcsRevisionNumber;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.zmlx.hg4idea.HgFile;
|
||||
import org.zmlx.hg4idea.HgFileRevision;
|
||||
|
||||
@@ -93,7 +92,7 @@ public class HgAnnotation implements FileAnnotation {
|
||||
return CurrentContentRevision.create(hgFile.toFilePath()).getContent();
|
||||
} catch (VcsException e) {
|
||||
LOG.info(e);
|
||||
return StringUtils.EMPTY;
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -144,7 +143,7 @@ public class HgAnnotation implements FileAnnotation {
|
||||
|
||||
public String getValue(int lineNumber) {
|
||||
if (lineNumber >= lines.size() || lineNumber < 0) {
|
||||
return StringUtils.EMPTY;
|
||||
return "";
|
||||
}
|
||||
HgAnnotationLine annotationLine = lines.get(lineNumber);
|
||||
return aspectType == FIELD.REVISION
|
||||
|
||||
@@ -15,7 +15,6 @@ package org.zmlx.hg4idea.ui;
|
||||
import com.intellij.openapi.options.ConfigurationException;
|
||||
import com.intellij.openapi.ui.TextFieldWithBrowseButton;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.zmlx.hg4idea.HgGlobalSettings;
|
||||
import org.zmlx.hg4idea.HgProjectSettings;
|
||||
import org.zmlx.hg4idea.HgVcsMessages;
|
||||
@@ -85,7 +84,7 @@ public class HgConfigurationProjectPanel {
|
||||
mySelectRadioButton.setSelected(!isAutodetectHg);
|
||||
myPathSelector.setEnabled(!isAutodetectHg);
|
||||
if (isAutodetectHg) {
|
||||
myPathSelector.setText(StringUtils.EMPTY);
|
||||
myPathSelector.setText("");
|
||||
} else {
|
||||
myPathSelector.setText(myProjectSettings.getHgExecutable());
|
||||
}
|
||||
|
||||
@@ -12,9 +12,9 @@
|
||||
// limitations under the License.
|
||||
package org.zmlx.hg4idea.ui;
|
||||
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.wm.CustomStatusBarWidget;
|
||||
import com.intellij.openapi.wm.StatusBar;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.zmlx.hg4idea.HgRevisionNumber;
|
||||
@@ -40,13 +40,13 @@ public class HgCurrentBranchStatus extends JLabel implements CustomStatusBarWidg
|
||||
if (length > 2) {
|
||||
parentsBuffer.delete(length - 2, length);
|
||||
}
|
||||
String statusText = StringUtils.isNotBlank(branch)
|
||||
String statusText = !StringUtil.isEmptyOrSpaces(branch)
|
||||
? HgVcsMessages.message("hg4idea.status.currentSituationtext", branch, parentsBuffer.toString()) : "";
|
||||
|
||||
String toolTipText = StringUtils.isNotBlank(statusText)
|
||||
String toolTipText = !StringUtil.isEmptyOrSpaces(statusText)
|
||||
? HgVcsMessages.message("hg4idea.status.currentSituation.description") : "";
|
||||
|
||||
setVisible(StringUtils.isNotBlank(branch));
|
||||
setVisible(!StringUtil.isEmptyOrSpaces(branch));
|
||||
setText(statusText);
|
||||
setToolTipText(toolTipText);
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ package org.zmlx.hg4idea.ui;
|
||||
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.ui.DialogWrapper;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
|
||||
import javax.swing.*;
|
||||
|
||||
@@ -28,7 +28,7 @@ public class HgGlobalStatusDialog extends DialogWrapper {
|
||||
}
|
||||
|
||||
public void append(String text) {
|
||||
if (StringUtils.isEmpty(text)) {
|
||||
if (StringUtil.isEmpty(text)) {
|
||||
return;
|
||||
}
|
||||
outputTextArea.append(text);
|
||||
|
||||
@@ -15,9 +15,9 @@ package org.zmlx.hg4idea.ui;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.ui.DialogWrapper;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.util.ui.UIUtil;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.zmlx.hg4idea.command.HgShowConfigCommand;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -104,7 +104,7 @@ public class HgPullDialog extends DialogWrapper {
|
||||
}
|
||||
|
||||
private void onChangePullSource() {
|
||||
setOKActionEnabled(StringUtils.isNotBlank(sourceTxt.getText()));
|
||||
setOKActionEnabled(!StringUtil.isEmptyOrSpaces(sourceTxt.getText()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -18,7 +18,6 @@ import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.ui.DialogWrapper;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.zmlx.hg4idea.HgPusher;
|
||||
@@ -139,7 +138,7 @@ public class HgPushDialog extends DialogWrapper {
|
||||
}
|
||||
|
||||
private boolean validateOptions() {
|
||||
return StringUtils.isNotBlank(repositoryTxt.getText())
|
||||
return !StringUtil.isEmptyOrSpaces(repositoryTxt.getText())
|
||||
&& !(revisionCbx.isSelected() && StringUtil.isEmptyOrSpaces(revisionTxt.getText()))
|
||||
&& !(branchCheckBox.isSelected() && (branchComboBox.getSelectedItem() == null));
|
||||
}
|
||||
|
||||
@@ -14,8 +14,8 @@ package org.zmlx.hg4idea.ui;
|
||||
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.ui.DialogWrapper;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.event.DocumentEvent;
|
||||
@@ -73,7 +73,7 @@ public class HgTagDialog extends DialogWrapper {
|
||||
}
|
||||
|
||||
private boolean validateOptions() {
|
||||
return StringUtils.isNotBlank(tagTxt.getText());
|
||||
return !StringUtil.isEmptyOrSpaces(tagTxt.getText());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
// limitations under the License.
|
||||
package org.zmlx.hg4idea.util;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.zmlx.hg4idea.execution.HgCommandResult;
|
||||
|
||||
@@ -27,7 +27,7 @@ public final class HgErrorUtil {
|
||||
return true;
|
||||
}
|
||||
String line = getLastErrorLine(result);
|
||||
return StringUtils.isNotBlank(line) && StringUtils.contains(line, "abort:");
|
||||
return !StringUtil.isEmptyOrSpaces(line) && line.contains("abort:");
|
||||
}
|
||||
|
||||
public static boolean isAuthorizationError(HgCommandResult result) {
|
||||
@@ -35,9 +35,9 @@ public final class HgErrorUtil {
|
||||
return true;
|
||||
}
|
||||
String line = getLastErrorLine(result);
|
||||
return StringUtils.isNotBlank(line) && (
|
||||
StringUtils.contains(line, "authorization required")
|
||||
|| StringUtils.contains(line, "authorization failed")
|
||||
return !StringUtil.isEmptyOrSpaces(line) && (
|
||||
line.contains("authorization required")
|
||||
|| line.contains("authorization failed")
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user