IDEA-136072 (fixed for Windows)

This commit is contained in:
Roman Shevchenko
2015-02-10 20:35:44 +01:00
parent 88a92d65ae
commit 37541e16f5
2 changed files with 6 additions and 7 deletions
@@ -15,10 +15,7 @@
*/
package com.intellij.openapi.application;
import com.intellij.openapi.util.NamedJDOMExternalizable;
import com.intellij.openapi.util.Pair;
import com.intellij.openapi.util.SystemInfo;
import com.intellij.openapi.util.SystemInfoRt;
import com.intellij.openapi.util.*;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.util.io.URLUtil;
@@ -399,7 +396,8 @@ public class PathManager {
value = "";
}
s = m.replaceAll(value);
s = StringUtil.replace(s, m.group(), value);
m = PROPERTY_REF.matcher(s);
}
return s;
@@ -48,9 +48,10 @@ public class PathManagerTest {
String home = System.clearProperty(PathManager.PROPERTY_HOME_PATH);
try {
assertEquals(PathManager.getHomePath() + "/build.txt", PathManager.substituteVars("${idea.home.path}/build.txt"));
assertEquals(PathManager.getHomePath() + "/build.txt", PathManager.substituteVars("${idea.home}/build.txt"));
assertEquals("/opt/idea/build.txt", PathManager.substituteVars("${idea.home.path}/build.txt", "/opt/idea"));
assertEquals(PathManager.getHomePath() + "\\build.txt", PathManager.substituteVars("${idea.home.path}\\build.txt"));
assertEquals("/opt/idea/build.txt", PathManager.substituteVars("${idea.home}/build.txt", "/opt/idea"));
assertEquals("C:\\opt\\idea\\build.txt", PathManager.substituteVars("${idea.home.path}\\build.txt", "C:\\opt\\idea"));
}
finally {
if (home != null) {