code: public static void setSymbol(JCTree tree, Symbol sym) {
          tree = skipParens(tree);
          switch (tree.getTag()) {
          case IDENT:
              ((JCIdent) tree).sym = sym; break;
          case SELECT:
              ((JCFieldAccess) tree).sym = sym; break;
          default:
          }
      }
docs: If this tree is an identifier or a field, set its symbol, otherwise skip.