PsiClassReferenceType () { PsiClassReferenceType myType = null; final PsiJavaCodeReferenceElement referenceElement = (PsiJavaCodeReferenceElement)mySmartPsiElementPointer.getElement(); final PsiElementFactory factory = JavaPsiFacade.getElementFactory(myProject); if (referenceElement != null) { myType = (PsiClassReferenceType)factory.createType(referenceElement); } else { try { myType = (PsiClassReferenceType)factory.createTypeFromText(myReferenceText, null); } catch (IncorrectOperationException e) { LOG.error(e); } } return myType; }