public static Symbol symbolFor(JCTree node) {
        node = skipParens(node);
        switch (node.getTag()) {
        case JCTree.CLASSDEF:
            return ((JCClassDecl) node).sym;
        case JCTree.METHODDEF:
            return ((JCMethodDecl) node).sym;
        case JCTree.VARDEF:
            return ((JCVariableDecl) node).sym;
        default:
            return null;
        }
    }