String (@NotNull String text, boolean caseSensitive) { if (text.indexOf('$') < 0 && text.indexOf('%') < 0) { return text; } for (Map.Entry<String, String> entry : myPlainMap.entrySet()) { // when replacing macros with actual paths, the replace utility may be used as always 'case-sensitive' // for case-insensitive file systems, there will be no unnecessary toLowerCase() transforms. text = StringUtil.replace(text, entry.getKey(), entry.getValue(), false); } for (String macroName : myMacroExpands.keySet()) { text = replaceMacro(text, macroName, myMacroExpands.get(macroName)); } return text; }