From 2becd4ff4faece361cc2a1bde62e4d0a9253bf14 Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Wed, 25 Mar 2015 19:20:15 +0300 Subject: [PATCH] do not access extensions too early --- .../openapi/components/impl/BasePathMacroManager.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/platform/projectModel-impl/src/com/intellij/openapi/components/impl/BasePathMacroManager.java b/platform/projectModel-impl/src/com/intellij/openapi/components/impl/BasePathMacroManager.java index ee528fd42208..98a639664623 100644 --- a/platform/projectModel-impl/src/com/intellij/openapi/components/impl/BasePathMacroManager.java +++ b/platform/projectModel-impl/src/com/intellij/openapi/components/impl/BasePathMacroManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * Copyright 2000-2015 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,7 +45,10 @@ import java.util.*; public class BasePathMacroManager extends PathMacroManager { private static final Logger LOG = Logger.getInstance("#com.intellij.openapi.components.impl.BasePathMacroManager"); - private static final CompositePathMacroFilter FILTER = new CompositePathMacroFilter(Extensions.getExtensions(PathMacrosCollector.MACRO_FILTER_EXTENSION_POINT_NAME)); + + private static class Holder { + private static final CompositePathMacroFilter FILTER = new CompositePathMacroFilter(Extensions.getExtensions(PathMacrosCollector.MACRO_FILTER_EXTENSION_POINT_NAME)); + } private PathMacrosImpl myPathMacros; @@ -188,7 +191,7 @@ public class BasePathMacroManager extends PathMacroManager { @Override public void collapsePaths(@NotNull final Element element) { - getReplacePathMap().substitute(element, SystemInfo.isFileSystemCaseSensitive, false, FILTER); + getReplacePathMap().substitute(element, SystemInfo.isFileSystemCaseSensitive, false, Holder.FILTER); } public int hashCode() {