void () { UExpression element = getUastElement(); LOG.assertTrue(element != null); PsiElement sourceElement = element.getSourcePsi(); LOG.assertTrue(sourceElement != null); final PsiMethod resolvedMethod = LambdaUtil.getFunctionalInterfaceMethod(sourceElement); if (resolvedMethod != null) { RefMethod resolvedRefMethod = ObjectUtils.tryCast(getRefManager().getReference(resolvedMethod), RefMethod.class); if (resolvedRefMethod != null) { resolvedRefMethod.addDerivedReference(this); resolvedRefMethod.initializeIfNeeded(); RefClass refClass = resolvedRefMethod.getOwnerClass(); if (refClass != null) { refClass.addDerivedReference(this); } if (element instanceof UCallableReferenceExpression && !TypeConversionUtil.isVoidType(resolvedMethod.getReturnType())) { ((RefMethodImpl)resolvedRefMethod).updateReturnValueTemplate(element); } } } if (element instanceof ULambdaExpression) { RefJavaUtil.getInstance().addReferencesTo(element, this, ((ULambdaExpression)element).getBody()); } else if (element instanceof UCallableReferenceExpression) { RefJavaUtil.getInstance().addReferencesTo(element, this, element); for (RefParameter parameter : getParameters()) { addReference(parameter, parameter.getPsiElement(), element, false, true, null); } } }