code: public String getQualifiedName(Node n) {
      if (n.getBooleanProp(Node.IS_MODULE_NAME)) {
        return n.getString();
      } else if (n.isGetProp()) {
        String left = getQualifiedName(n.getFirstChild());
        if (left == null) {
          return null;
        }
        return left + "." + n.getLastChild().getString();
      }
      return n.getQualifiedName();
    }
docs: This variant of Node#getQualifiedName is adds special support for
  IS_MODULE_NAME.