LocalQuickFix (@NotNull PsiPrefixExpression prefixExpr) { final PsiExpression operand = prefixExpr.getOperand(); boolean increment; if (isDesiredPrefixExpression(prefixExpr, true)) { increment = true; } else if (isDesiredPrefixExpression(prefixExpr, false)) { increment = false; } else { return null; } if (operand instanceof PsiReferenceExpression) { final PsiPrefixExpression parentPrefixExpr = ObjectUtils.tryCast(prefixExpr.getParent(), PsiPrefixExpression.class); if (isDesiredPrefixExpression(parentPrefixExpr, increment) && containsOnlyWhitespaceBetweenOperatorAndOperand(prefixExpr) && containsOnlyWhitespaceBetweenOperatorAndOperand(parentPrefixExpr)) { return createFix((PsiReferenceExpression)operand, increment); } } else if (operand instanceof PsiPrefixExpression && isDesiredPrefixExpression((PsiPrefixExpression)operand, increment)) { final PsiExpression operandExpr = ((PsiPrefixExpression)operand).getOperand(); final PsiReferenceExpression operandRefExpr = ObjectUtils.tryCast(operandExpr, PsiReferenceExpression.class); if (operandRefExpr != null && containsOnlyWhitespaceBetweenOperatorAndOperand(prefixExpr) && containsOnlyWhitespaceBetweenOperatorAndOperand((PsiPrefixExpression)operand)) { return createFix(operandRefExpr, increment); } } return null; }