void (PsiVariable variable, Collection<PsiReferenceExpression> refs) { if (myNullables instanceof HashSet) return; // already filled myNullables = new HashSet<>(); PsiExpression initializer = variable.getInitializer(); if (initializer != null && NullabilityUtil.getExpressionNullability(initializer, true) != Nullability.NOT_NULL) { myNullables.add(initializer); } for (PsiReferenceExpression refExpr : refs) { if (NullabilityUtil.getExpressionNullability(refExpr, true) != Nullability.NOT_NULL) { myNullables.add(refExpr); } if(PsiUtil.isOnAssignmentLeftHand(refExpr)) { PsiExpression rExpr = ExpressionUtils.getAssignmentTo(PsiTreeUtil.getParentOfType(refExpr, PsiAssignmentExpression.class), variable); if (rExpr != null && NullabilityUtil.getExpressionNullability(rExpr, true) != Nullability.NOT_NULL) { myNullables.add(rExpr); } } } }