private static GuardedByExpression bind(JCTree.JCExpression exp, BinderContext context) { GuardedByExpression expr = BINDER.visit(exp, context); checkGuardedBy(expr != null, String.valueOf(exp)); checkGuardedBy(expr.kind() != Kind.TYPE_LITERAL, "Raw type literal: %s", exp); return expr; }
@Override public Void visitSynchronized(SynchronizedTree node, Context context) { scan(SKIP_PARENS.visit(node.getExpression(), null), context); scan(node.getBlock(), context); return null; }
@Override public Void visitDoWhileLoop(DoWhileLoopTree node, Context context) { scan(node.getStatement(), context); scan(SKIP_PARENS.visit(node.getCondition(), null), context); return null; }
@Override public Void visitWhileLoop(WhileLoopTree node, Context context) { scan(SKIP_PARENS.visit(node.getCondition(), null), context); scan(node.getStatement(), context); return null; }
@Override public Void visitIf(IfTree node, Context context) { scan(SKIP_PARENS.visit(node.getCondition(), null), context); scan(node.getThenStatement(), context); scan(node.getElseStatement(), context); return null; } }
@Override public Void visitMethodInvocation( MethodInvocationTree node, BiConsumer<MethodInvocationTree, Name> biConsumer) { Name identifier = OWNED_IDENTIFIER.visit(node.getMethodSelect(), null); if (identifier != null) { biConsumer.accept(node, identifier); } return super.visitMethodInvocation(node, biConsumer); } };
public final R visit(Iterable<? extends Tree> nodes, P p) { R r = null; if (nodes != null) for (Tree node : nodes) r = visit(node, p); return r; }
public final R visit(Iterable<? extends Tree> nodes, P p) { R r = null; if (nodes != null) for (Tree node : nodes) r = visit(node, p); return r; }
public final R visit(Iterable<? extends Tree> nodes, P p) { R r = null; if (nodes != null) for (Tree node : nodes) r = visit(node, p); return r; }
public final R visit(Iterable<? extends Tree> nodes, P p) { R r = null; if (nodes != null) for (Tree node : nodes) r = visit(node, p); return r; }
@Override public Void visitMethodInvocation( MethodInvocationTree node, BiConsumer<MethodInvocationTree, Name> biConsumer) { Name identifier = OWNED_IDENTIFIER.visit(node.getMethodSelect(), null); if (identifier != null) { biConsumer.accept(node, identifier); } return super.visitMethodInvocation(node, biConsumer); } };
private static GuardedByExpression bind(JCTree.JCExpression exp, BinderContext context) { GuardedByExpression expr = BINDER.visit(exp, context); checkGuardedBy(expr != null, String.valueOf(exp)); checkGuardedBy(expr.kind() != Kind.TYPE_LITERAL, "Raw type literal: %s", exp); return expr; }
@Override public Void visitDoWhileLoop(DoWhileLoopTree node, Context context) { scan(node.getStatement(), context); scan(SKIP_PARENS.visit(node.getCondition(), null), context); return null; }
@Override public Void visitSynchronized(SynchronizedTree node, Context context) { scan(SKIP_PARENS.visit(node.getExpression(), null), context); scan(node.getBlock(), context); return null; }
@Override public Void visitWhileLoop(WhileLoopTree node, Context context) { scan(SKIP_PARENS.visit(node.getCondition(), null), context); scan(node.getStatement(), context); return null; }
@Override public Void visitIf(IfTree node, Context context) { scan(SKIP_PARENS.visit(node.getCondition(), null), context); scan(node.getThenStatement(), context); scan(node.getElseStatement(), context); return null; } }