Package com.sun.source.tree

Examples of com.sun.source.tree.TryTree


    /**
     * Match a tree in the ancestor chain given the ancestor's immediate descendant.
     */
    protected MatchResult matchAncestor(Tree leaf, Tree prevTree) {
      if (leaf instanceof TryTree) {
        TryTree tryTree = (TryTree) leaf;
        if (tryTree.getFinallyBlock() != null && tryTree.getFinallyBlock().equals(prevTree)) {
          return MatchResult.FOUND_ERROR;
        }
      }

      return MatchResult.KEEP_LOOKING;
View Full Code Here


   */
  private class FinallyThrowMatcher extends FinallyCompletionMatcher<ThrowTree> {
    @Override
    protected MatchResult matchAncestor(Tree tree, Tree prevTree) {
      if (tree instanceof TryTree) {
        TryTree tryTree = (TryTree) tree;
        if (tryTree.getBlock().equals(prevTree) && !tryTree.getCatches().isEmpty()) {
          // The current ancestor is a try block with associated catch blocks.
          return MatchResult.NO_MATCH;
        }
      }

View Full Code Here

TOP

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

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.