Examples of JCWhileLoop


Examples of com.sun.tools.javac.tree.JCTree.JCWhileLoop

public class ElementsCountedInLoop extends BugChecker
    implements EnhancedForLoopTreeMatcher, WhileLoopTreeMatcher {

  @Override
  public Description matchWhileLoop(WhileLoopTree tree, VisitorState state) {
    JCWhileLoop whileLoop = (JCWhileLoop) tree;
    JCExpression whileExpression = ((JCParens) whileLoop.getCondition()).getExpression();
    if (whileExpression instanceof MethodInvocationTree) {
      MethodInvocationTree methodInvocation = (MethodInvocationTree) whileExpression;
      if (methodSelect(isDescendantOfMethod("java.util.Iterator", "hasNext()")).matches(
          methodInvocation, state)) {
        IdentifierTree identifier = getIncrementedIdentifer(extractSingleStatement(whileLoop.body));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.