void (@NotNull ActionContext context, @NotNull PsiArrayAccessExpression arrayAccess, @NotNull ModPsiUpdater updater) { final PsiExpression arrayExpression = arrayAccess.getArrayExpression(); final PsiExpression indexExpression = arrayAccess.getIndexExpression(); if (indexExpression == null) return; Project project = context.project(); final PsiElementFactory factory = JavaPsiFacade.getElementFactory(project); final CodeStyleManager codeStyleManager = CodeStyleManager.getInstance(project); final PsiElement parent = arrayAccess.getParent(); if (parent instanceof PsiAssignmentExpression assignmentExpression) { final PsiExpression lExpression = assignmentExpression.getLExpression(); final PsiExpression rExpression = assignmentExpression.getRExpression(); if (lExpression.equals(arrayAccess) && parent.getParent() instanceof PsiExpressionStatement && rExpression != null) { replaceWithSet(factory, codeStyleManager, arrayExpression, indexExpression, rExpression, assignmentExpression); return; } } replaceWithGet(factory, codeStyleManager, arrayExpression, indexExpression, arrayAccess); }