ConversionResult (@NotNull PsiType targetType, @NotNull PsiType actualType, @NotNull Position position, @NotNull GroovyPsiElement context) { if (!PsiTypesUtil.classNameEquals(targetType, CommonClassNames.JAVA_LANG_CLASS)) { return null; } if (PsiTypesUtil.classNameEquals(actualType, CommonClassNames.JAVA_LANG_CLASS)) { return null; } if (actualType == PsiTypes.nullType()) return ConversionResult.OK; final GrLiteral literal = getLiteral(context); final Object value = literal == null ? null : literal.getValue(); final String fqn = value == null ? null : value.toString(); final PsiClass psiClass = fqn == null ? null : JavaPsiFacade.getInstance(context.getProject()).findClass( fqn, context.getResolveScope() ); return psiClass == null ? ConversionResult.WARNING : ConversionResult.OK; }