void (@NotNull PsiReferenceExpression expression) { super.visitReferenceExpression(expression); final PsiVariable variable = tryCast(expression.resolve(), PsiVariable.class); if (variable == null) return; List<BoxingInfo> infos = myBoxingMap.get(variable); if (infos == null) return; Iterator<BoxingInfo> iterator = infos.iterator(); while (iterator.hasNext()) { BoxingInfo boxingInfo = iterator.next(); if (!ExpressionUtils.isReferenceTo(expression, boxingInfo.myVariable)) continue; boxingInfo.myHasReferences = true; final Integer boxingRemovalImpact = afterBoxingRemovalReferenceBoostedImpact(expression, boxingInfo); if (boxingRemovalImpact == null) { iterator.remove(); } else { boxingInfo.myAfterRemovalOperationCountDiff += boxingRemovalImpact; } break; } if (infos.isEmpty()) { myBoxingMap.remove(variable); } }