@Override public void visitPostfixExpression(@NotNull PsiPostfixExpression postfixExpression) { if (read || written) { return; } super.visitPostfixExpression(postfixExpression); final PsiJavaToken operationSign = postfixExpression.getOperationSign(); final IElementType tokenType = operationSign.getTokenType(); if (!tokenType.equals(JavaTokenType.PLUSPLUS) && !tokenType.equals(JavaTokenType.MINUSMINUS)) { return; } final PsiExpression operand = postfixExpression.getOperand(); if (!(operand instanceof PsiReferenceExpression)) { return; } final PsiReferenceExpression referenceExpression = (PsiReferenceExpression) operand; final PsiElement target = referenceExpression.resolve(); if (!variable.equals(target)) { return; } written = true; }
public void visitPostfixExpression(PsiPostfixExpression expression) { super.visitPostfixExpression(expression); checkSetterNeeded(expression.getOperand(), expression.getOperationSign()); }