PsiIdentifier (@NotNull GrNamedElement namedElement) { final PsiElement element = namedElement.getNameIdentifierGroovy(); JavaIdentifier identifier = element.getUserData(NAME_IDENTIFIER); if (identifier == null) { //noinspection SynchronizationOnLocalVariableOrMethodParameter synchronized (element) { identifier = element.getUserData(NAME_IDENTIFIER); if (identifier != null) { return identifier; } identifier = new JavaIdentifier(element.getManager(), element); element.putUserData(NAME_IDENTIFIER, identifier); } } return identifier; }