Package com.sun.source.tree

Examples of com.sun.source.tree.BinaryTree


          SuggestedFix.replace(methodInvocationTree, arg1.toString()));
    }

    // Comparison to null
    if (arg1.getKind() == Kind.EQUAL_TO || arg1.getKind() == Kind.NOT_EQUAL_TO) {
      BinaryTree binaryExpr = (BinaryTree) arg1;
      if (binaryExpr.getLeftOperand().getKind() == Kind.NULL_LITERAL) {
        return describeMatch(arg1,
            SuggestedFix.replace(arg1, binaryExpr.getRightOperand().toString()));
      }
      if (binaryExpr.getRightOperand().getKind() == Kind.NULL_LITERAL) {
        return describeMatch(arg1,
            SuggestedFix.replace(arg1, binaryExpr.getLeftOperand().toString()));
      }
    }

    if ((arg1 instanceof BinaryTree || arg1.getKind() == Kind.METHOD_INVOCATION ||
         arg1.getKind() == Kind.LOGICAL_COMPLEMENT) &&
View Full Code Here


    if (TreeUtils.isUseOfElement(tree)) {
      Element elt = TreeUtils.elementFromUse(tree);
      return ElementUtils.isCompileTimeConstant(elt);
    } else if (TreeUtils.isStringConcatenation(tree)) {
      BinaryTree binOp = (BinaryTree) tree;
      return isCompileTimeString(binOp.getLeftOperand()) && isCompileTimeString(binOp.getRightOperand());
    } else {
      return false;
    }
  }
View Full Code Here

        JavacTaskImpl ct = (JavacTaskImpl) tool.getTask(null, null, null, Arrays.asList("-bootclasspath", bootPath, "-Xjcov"), null, Arrays.asList(new MyFileObject(code)));
        CompilationUnitTree cut = ct.parse().iterator().next();
        ClassTree clazz = (ClassTree) cut.getTypeDecls().get(0);
        MethodTree method = (MethodTree) clazz.getMembers().get(0);
        VariableTree condSt = (VariableTree) method.getBody().getStatements().get(1);
        BinaryTree cond = (BinaryTree) condSt.getInitializer();
        JCTree condJC = (JCTree) cond;

        if (condJC.pos != 93)
            throw new IllegalStateException("Unexpected position=" + condJC.pos);
    }
View Full Code Here

TOP

Related Classes of com.sun.source.tree.BinaryTree

Copyright © 2018 www.massapicom. 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.