src/share/classes/com/sun/tools/javac/tree/TreeInfo.java

changeset 672
ea54372637a5
parent 668
25dd23fa2511
child 724
7755f47542a0
equal deleted inserted replaced
671:68e765b1e9ed 672:ea54372637a5
632 return ((JCMethodDecl) node).sym; 632 return ((JCMethodDecl) node).sym;
633 case JCTree.VARDEF: 633 case JCTree.VARDEF:
634 return ((JCVariableDecl) node).sym; 634 return ((JCVariableDecl) node).sym;
635 default: 635 default:
636 return null; 636 return null;
637 }
638 }
639
640 public static boolean isDeclaration(JCTree node) {
641 node = skipParens(node);
642 switch (node.getTag()) {
643 case JCTree.CLASSDEF:
644 case JCTree.METHODDEF:
645 case JCTree.VARDEF:
646 return true;
647 default:
648 return false;
637 } 649 }
638 } 650 }
639 651
640 /** If this tree is an identifier or a field, return its symbol, 652 /** If this tree is an identifier or a field, return its symbol,
641 * otherwise return null. 653 * otherwise return null.

mercurial