XmlIndex () { Configuration configuration = getConfiguration(); XmlIndex index = myXmlIndex; if (index == null || configuration.getModificationCount() != index.modCount) { final Map<ElementPattern<?>, BaseInjection> map = new HashMap<>(); for (BaseInjection injection : configuration.getInjections(XmlLanguageInjectionSupport.XML_SUPPORT_ID)) { for (InjectionPlace place : injection.getInjectionPlaces()) { if (!place.isEnabled() || place.getElementPattern() == null) continue; map.put(place.getElementPattern(), injection); } } final Collection<String> stringSet = PatternValuesIndex.buildStringIndex(map.keySet()); index = new XmlIndex(configuration.getModificationCount(), buildPattern(stringSet), stringSet); myXmlIndex = index; } return index; }