if (myMacroMap == null) {
// the insertion order is important for later iterations, so LinkedHashMap is used
myMacroMap = new LinkedHashMap<String, String>();
// ApplicationManager.getApplication() will return null if executed in ParameterListTest
final Application application = ApplicationManager.getApplication();
if (application != null) {
application.runReadAction(new Runnable() {
public void run() {
final PathMacros pathMacros = PathMacros.getInstance();
final Set<String> names = pathMacros.getAllMacroNames();
for (String name : names) {
myMacroMap.put("${" + name + "}", pathMacros.getValue(name));