fixing typo

This commit is contained in:
peter
2012-09-19 19:47:39 +04:00
parent b797ea2b26
commit d6fa9c3b61
6 changed files with 20 additions and 17 deletions
@@ -60,7 +60,7 @@ public final class EditExternallyAction extends AnAction {
}
else {
if (files != null) {
Map<String, String> env = EnvironmentUtil.getEnviromentProperties();
Map<String, String> env = EnvironmentUtil.getEnvironmentProperties();
Set<String> varNames = env.keySet();
for (String varName : varNames) {
if (SystemInfo.isWindows) {
@@ -339,7 +339,7 @@ public class ParametersList implements Cloneable {
myMacroMap.put("${" + name + "}", value);
}
}
final Map<String, String> env = EnvironmentUtil.getEnviromentProperties();
final Map<String, String> env = EnvironmentUtil.getEnvironmentProperties();
for (String name : env.keySet()) {
final String key = "${" + name + "}";
if (!myMacroMap.containsKey(key)) {
@@ -21,29 +21,33 @@ import java.util.Collections;
import java.util.Map;
public class EnvironmentUtil {
private static final Map<String, String> ourEnviromentProperties = Collections.unmodifiableMap(new ProcessBuilder().environment());
private static final Map<String, String> ourEnvironmentProperties = Collections.unmodifiableMap(new ProcessBuilder().environment());
private EnvironmentUtil() {
}
@SuppressWarnings("UnusedDeclaration")
@Deprecated
@NonNls
public static Map<String, String> getEnviromentProperties() {
return ourEnviromentProperties;
return getEnvironmentProperties();
}
public static String[] getFlattenEnvironmentProperties() {
return getEnvironment();
@NonNls
public static Map<String, String> getEnvironmentProperties() {
return ourEnvironmentProperties;
}
public static String[] getEnvironment() {
Map enviroment = getEnviromentProperties();
String[] envp = new String[enviroment.size()];
return flattenEnvironment(getEnvironmentProperties());
}
public static String[] flattenEnvironment(Map<String, String> environment) {
String[] array = new String[environment.size()];
int i = 0;
for (Object o : enviroment.keySet()) {
String name = (String)o;
String value = (String)enviroment.get(name);
envp[i++] = name + "=" + value;
for (String name : environment.keySet()) {
array[i++] = name + "=" + environment.get(name);
}
return envp;
return array;
}
}
@@ -8,7 +8,6 @@
*/
package com.intellij.util;
import com.intellij.util.EnvironmentUtil;
import com.intellij.openapi.util.SystemInfo;
import junit.framework.TestCase;
@@ -16,7 +15,7 @@ import java.util.Map;
public class EnvironmentUtilTest extends TestCase {
public void test1() {
Map enviromentProperties = EnvironmentUtil.getEnviromentProperties();
Map enviromentProperties = EnvironmentUtil.getEnvironmentProperties();
assertNotNull(enviromentProperties);
if(SystemInfo.isWindows)
assertNotNull(enviromentProperties.get("Path"));
@@ -142,7 +142,7 @@ public abstract class ConnectionOnProcess implements IConnection {
protected synchronized void execute(GeneralCommandLine commandLine) throws AuthenticationException {
try {
commandLine.setEnvParams(EnvironmentUtil.getEnviromentProperties());
commandLine.setEnvParams(EnvironmentUtil.getEnvironmentProperties());
myProcess = commandLine.createProcess();
myErrThread = new ReadProcessThread(
@@ -72,7 +72,7 @@ public abstract class CvsOperation {
};
private final static Map<String, String> ourEnvironmentVariablesMap = new HashMap<String, String>();
static {
final Map<String, String> environmentProperties = EnvironmentUtil.getEnviromentProperties();
final Map<String, String> environmentProperties = EnvironmentUtil.getEnvironmentProperties();
for (String name : ourKnownToCvs) {
final String value = environmentProperties.get(name);
if (value != null) {