DuplocatorState (PsiFragment frag) { if (frag == null) { return null; } final Language language = frag.getLanguage(); if (language == null) { return null; } final DuplicatesProfile profile = DuplicatesProfile.findProfileForLanguage(language); return profile != null ? profile.getDuplocatorState(language) : null; }