mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-01 18:58:31 +07:00
unused return value inspection: method reference awareness (IDEA-134991)
This commit is contained in:
@@ -211,6 +211,14 @@ public class RefJavaUtilImpl extends RefJavaUtil{
|
||||
PsiMethod psiMethod = (PsiMethod)psiResolved;
|
||||
RefMethodImpl refMethod = (RefMethodImpl)refResolved;
|
||||
|
||||
if (refExpression instanceof PsiMethodReferenceExpression) {
|
||||
PsiType returnType = psiMethod.getReturnType();
|
||||
if (!psiMethod.isConstructor() && returnType != PsiType.VOID) {
|
||||
refMethod.setReturnValueUsed(true);
|
||||
addTypeReference(psiFrom, returnType, refFrom.getRefManager());
|
||||
}
|
||||
return;
|
||||
}
|
||||
PsiMethodCallExpression call = PsiTreeUtil.getParentOfType(
|
||||
refExpression,
|
||||
PsiMethodCallExpression.class
|
||||
|
||||
Reference in New Issue
Block a user