debugging PathMacroManagerTest

This commit is contained in:
peter
2012-06-29 14:39:31 +02:00
parent 48def64a25
commit 301fd02f1e
3 changed files with 16 additions and 0 deletions
@@ -120,10 +120,12 @@ public class PathMacroManagerTest {
myOldFileSystem = FileSystem.FILE_SYSTEM;
myFileSystem = new MockFileSystem();
FileSystem.FILE_SYSTEM = myFileSystem;
BasePathMacroManager.DEBUG = true;
}
@After
public final void restoreFilesystem() throws Exception {
BasePathMacroManager.DEBUG = false;
FileSystem.FILE_SYSTEM = myOldFileSystem;
}
@@ -16,6 +16,7 @@
package com.intellij.application.options;
import com.intellij.openapi.components.PathMacroMap;
import com.intellij.openapi.components.impl.BasePathMacroManager;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.util.StringBuilderSpinAllocator;
import com.intellij.util.containers.ContainerUtil;
@@ -67,6 +68,13 @@ public class ReplacePathToMacroMap extends PathMacroMap {
final String p = quotePath(path);
final String m = "$" + macroName + "$";
if (BasePathMacroManager.DEBUG) {
System.out.println("BasePathMacroManager.addFileHierarchyReplacements");
System.out.println("path = " + p);
System.out.println("macro = " + macroName);
}
put(p, m);
for (String protocol : PROTOCOLS) {
put(protocol + ":" + p, protocol + ":" + m);
@@ -36,6 +36,7 @@ import org.jetbrains.annotations.Nullable;
import java.util.*;
public class BasePathMacroManager extends PathMacroManager {
public static boolean DEBUG = false;
private PathMacrosImpl myPathMacros;
public BasePathMacroManager(@Nullable PathMacros pathMacros) {
@@ -69,6 +70,11 @@ public class BasePathMacroManager extends PathMacroManager {
boolean check = false;
while (dir != null && dir.getParent() != null) {
path = dir.getPath();
if (DEBUG) {
System.out.println("BasePathMacroManager.addFileHierarchyReplacements");
System.out.println("path = " + path);
System.out.println("macro = " + macro);
}
putIfAbsent(result, "file:" + path, "file:" + macro, check);
putIfAbsent(result, "file:/" + path, "file:/" + macro, check);