boolean (PsiExpression element, @Nullable PsiVariable variableToIgnore, List<? super PsiElement> sideEffects) { if (sideEffects == null || element == null) return false; List<PsiElement> writes = new ArrayList<>(); Predicate<PsiElement> allowedSideEffect; if (variableToIgnore == null) { allowedSideEffect = e -> false; } else { allowedSideEffect = e -> e instanceof PsiAssignmentExpression && ExpressionUtils.isReferenceTo(((PsiAssignmentExpression)e).getLExpression(), variableToIgnore); } SideEffectChecker.checkSideEffects(element, writes, allowedSideEffect); sideEffects.addAll(writes); return !writes.isEmpty(); }