AnnotationContext (@NotNull UExpression expression) { UElement parent = expression.getUastParent(); UCallExpression callExpression = UastUtils.getUCallExpression(parent, 1); if (callExpression == null) return EMPTY; PsiMethod method = callExpression.resolve(); if (method == null) return EMPTY; PsiParameter parameter = getParameter(method, callExpression, expression); if (parameter == null) return EMPTY; PsiType parameterType = parameter.getType(); PsiElement psi = callExpression.getSourcePsi(); if (psi instanceof PsiMethodCallExpression) { PsiSubstitutor substitutor = ((PsiMethodCallExpression)psi).getMethodExpression().advancedResolve(false).getSubstitutor(); parameterType = substitutor.substitute(parameterType); } return fromModifierListOwner(parameter).withType(parameterType).withPlace(callExpression.getSourcePsi()); }