docs: String findCanonParentName() {
      int pos = name.indexOf(',');
      if (pos == -1) {
        int canonPos = key.canonicalName.indexOf(',');
        return canonPos == -1 ? null : key.canonicalName.substring(canonPos + 1);
      } else {
        int commas = 1;
        for (int i = pos + 1; i < name.length(); ++i) {
          if (name.charAt(i) == ',') {
            ++commas;
          }
        }
        int canonPos;
        for (canonPos = 0; canonPos < key.canonicalName.length() && commas >= 0; ++canonPos) {
          if (key.canonicalName.charAt(canonPos) == ',') {
            --commas;
          }
        }
        if (commas == 0) {
          return null;
        } else if (commas != -1 || canonPos == key.canonicalName.length()) {
          return null;
        } else {
          return key.canonicalName.substring(canonPos + 1);
        }
      }
    }