@Override
 public void visitUnaryExpression(UnaryExpressionTree tree) {
   if ((isIncrement(tree) || isDecrement(tree)) && tree.expression().is(Tree.Kind.IDENTIFIER)) {
     checkIdentifier((IdentifierTree) tree.expression());
   }
   super.visitUnaryExpression(tree);
 }
 @Override
 public void visitExpressionStatement(ExpressionStatementTree tree) {
   ExpressionTree expressionTree = tree.expression();
   if (isIncrementOrDecrement(expressionTree)) {
     UnaryExpressionTree unaryExpressionTree = (UnaryExpressionTree) expressionTree;
     expressionTree = unaryExpressionTree.expression();
   }
   scan(expressionTree);
 }
Beispiel #3
0
 private void buildUnaryExpression(UnaryExpressionTree tree) {
   currentBlock.elements.add(tree);
   build(tree.expression());
 }
 private boolean isDecrement(UnaryExpressionTree tree) {
   return tree.is(Tree.Kind.POSTFIX_DECREMENT) || tree.is(Tree.Kind.PREFIX_DECREMENT);
 }