String (@NotNull PsiElement node, @NotNull String previousText) { // Short class name is matched with fully qualified name if (node instanceof PsiJavaCodeReferenceElement || node instanceof PsiClass) { final PsiElement element = (node instanceof PsiJavaCodeReferenceElement) ? ((PsiJavaCodeReferenceElement)node).resolve() : node; if (element instanceof PsiClass) { String text = ((PsiClass)element).getQualifiedName(); if (previousText.equals(text)) { text = ((PsiClass)element).getName(); } return text; } } else if (node instanceof PsiLiteralExpression || node instanceof PsiComment) { return node.getText(); } return null; }