GrClassReferenceType () { final GrCodeReferenceElement reference = mySmartPsiElementPointer.getElement(); if (reference != null) { return new GrClassReferenceType(reference); } try { final GroovyPsiElementFactory factory = GroovyPsiElementFactory.getInstance(myProject); GrTypeElement typeElement = factory.createTypeElement(myReferenceText, null); return (GrClassReferenceType)typeElement.getType(); } catch (IncorrectOperationException e) { LOG.error(e); } return null; }