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 e48d1a70d67d..cef04a6b2f3d 100644 --- a/platform/platform-impl/src/com/intellij/application/options/PathMacrosCollector.java +++ b/platform/platform-impl/src/com/intellij/application/options/PathMacrosCollector.java @@ -19,6 +19,7 @@ import com.intellij.openapi.application.PathMacros; import com.intellij.openapi.components.PathMacroMap; import com.intellij.util.NotNullFunction; import org.jdom.Element; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import java.util.Arrays; @@ -45,24 +46,24 @@ public class PathMacrosCollector extends PathMacroMap { myMatcher = MACRO_PATTERN.matcher(""); } - public static Set getMacroNames(Element root) { - return getMacroNames(root, null); - } - public static Set getMacroNames(Element root, @Nullable final NotNullFunction filter) { return getMacroNames(root, filter, null); } - public static Set getMacroNames(Element root, @Nullable final NotNullFunction filter, @Nullable final NotNullFunction recursiveFilter) { + public static Set getMacroNames(Element root, @Nullable final NotNullFunction filter, @Nullable final NotNullFunction recursiveFilter, @NotNull final PathMacros pathMacros) { final PathMacrosCollector collector = new PathMacrosCollector(); collector.substitute(root, true, false, filter, recursiveFilter); final HashSet result = new HashSet(collector.myMacroMap.keySet()); result.removeAll(ourSystemMacroNames); result.removeAll(PathMacrosImpl.getToolMacroNames()); - result.removeAll(PathMacros.getInstance().getIgnoredMacroNames()); + result.removeAll(pathMacros.getIgnoredMacroNames()); return result; } + public static Set getMacroNames(Element root, @Nullable final NotNullFunction filter, @Nullable final NotNullFunction recursiveFilter) { + return getMacroNames(root, filter, recursiveFilter, PathMacros.getInstance()); + } + @Override public String substituteRecursively(String text, boolean caseSensitive) { if (text == null || text.length() == 0) return text; @@ -84,7 +85,7 @@ public class PathMacrosCollector extends PathMacroMap { protocol = FILE_PROTOCOL; } else if (text.length() > 6 && text.charAt(0) == 'j') { protocol = JAR_PROTOCOL; - } else if (!('$' == text.charAt(0))) { + } else if ('$' != text.charAt(0)) { return text; } diff --git a/platform/platform-impl/src/com/intellij/openapi/components/impl/stores/StorageUtil.java b/platform/platform-impl/src/com/intellij/openapi/components/impl/stores/StorageUtil.java index 4bc0f9240a65..351e8c9e3d5c 100644 --- a/platform/platform-impl/src/com/intellij/openapi/components/impl/stores/StorageUtil.java +++ b/platform/platform-impl/src/com/intellij/openapi/components/impl/stores/StorageUtil.java @@ -240,6 +240,9 @@ public class StorageUtil { return false; // do not proceed environment variables from run configurations } + if ("MESSAGE".equals(parentName) && "value".equals(attribute.getName())) return false; + if ("option".equals(parentName) && "LAST_COMMIT_MESSAGE".equals(parent.getAttributeValue("name"))) return false; + // do not proceed macros in searchConfigurations (structural search) if ("replaceConfiguration".equals(parentName) || "searchConfiguration".equals(parentName)) return false; }