From 83cecfceb4e9cd3cacc3616e32407e0708e4b773 Mon Sep 17 00:00:00 2001 From: Alexey Pegov Date: Wed, 28 Oct 2009 16:07:46 +0300 Subject: [PATCH] IDEADEV-41001 $MODULE_DIR$ as test working directory is reported as not defined, but works --- .../src/com/intellij/application/options/PathMacrosCollector.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/platform/platform-impl/src/com/intellij/application/options/PathMacrosCollector.java b/platform/platform-impl/src/com/intellij/application/options/PathMacrosCollector.java index 988c6b78bb..8ffc757d1d 100644 --- a/platform/platform-impl/src/com/intellij/application/options/PathMacrosCollector.java +++ b/platform/platform-impl/src/com/intellij/application/options/PathMacrosCollector.java @@ -18,6 +18,7 @@ package com.intellij.application.options; import com.intellij.openapi.components.PathMacroMap; import org.jdom.Element; +import java.util.Arrays; import java.util.HashSet; import java.util.Set; import java.util.regex.Matcher; @@ -32,6 +33,9 @@ public class PathMacrosCollector extends PathMacroMap { private static final String FILE_PROTOCOL = "file://"; private static final String JAR_PROTOCOL = "jar://"; + private static final Set ourSystemMacroNames = new HashSet( + Arrays.asList(PathMacrosImpl.APPLICATION_HOME_MACRO_NAME, PathMacrosImpl.MODULE_DIR_MACRO_NAME, PathMacrosImpl.PROJECT_DIR_MACRO_NAME)); + private PathMacrosCollector() { Pattern pattern = Pattern.compile("\\$(.*?)\\$"); myMatcher = pattern.matcher(""); @@ -40,7 +44,9 @@ public class PathMacrosCollector extends PathMacroMap { public static Set getMacroNames(Element root) { final PathMacrosCollector collector = new PathMacrosCollector(); collector.substitute(root, true); - return new HashSet(collector.myMacroMap.keySet()); + final HashSet result = new HashSet(collector.myMacroMap.keySet()); + result.removeAll(ourSystemMacroNames); + return result; } public String substitute(String text, boolean caseSensitive) { -- 2.11.4.GIT