code: private SourcePosition getNamePosition(Tree node) {
      int start = (int) sourcePositions.getStartPosition(unit, node);
      if (start == -1) {
        return SourcePosition.NO_POSITION;
      }
      String src = newUnit.getSource();
      Kind kind = node.getKind();
      if (kind == Kind.ANNOTATION_TYPE
          || kind == Kind.CLASS
          || kind == Kind.ENUM
          || kind == Kind.INTERFACE) {
        // Skip the class/enum/interface token.
        while (src.charAt(start++) != ' ') {}
      } else if (kind != Kind.METHOD && kind != Kind.VARIABLE) {
        return getPosition(node);
      }
      if (!Character.isJavaIdentifierStart(src.charAt(start))) {
        return getPosition(node);
      }
      int endPos = start + 1;
      while (Character.isJavaIdentifierPart(src.charAt(endPos))) {
        endPos++;
      }
      return getSourcePosition(start, endPos);
    }
docs: Return best guess for the position of a declaration node's name.