String generateTypeParameters(PsiTypeParameterListOwner owner, boolean useShortNames) {
    if (owner.hasTypeParameters()) {
      PsiTypeParameter[] parameters = owner.getTypeParameters();

      StringBuilder buffer = new StringBuilder();
      appendStyledSpan(buffer, getHighlightingManager().getOperationSignAttributes(), LT);

      PsiFile file = owner.getContainingFile();
      boolean allExtends =
        parameters.length > 1 & ContainerUtil.and(parameters, parameter -> parameter.getExtendsList().getReferenceElements().length > 0);
      int indent = getIndent(!allExtends, file);
      if (indent > 0) {
        buffer.append("\n");
      }

      for (int i = 0; i < parameters.length; i++) {
        buffer.append(StringUtil.repeatSymbol(' ', indent));
        PsiTypeParameter p = parameters[i];

        generateTypeAnnotations(buffer, p, p, true, false);

        appendStyledSpan(
          buffer,
          getHighlightingManager().getTypeParameterNameAttributes(),
          Objects.requireNonNullElse(p.getName(), CommonBundle.getErrorTitle()));

        PsiClassType[] refs = p.getExtendsList().getReferencedTypes();
        if (refs.length > 0) {
          appendStyledSpan(buffer, getHighlightingManager().getKeywordAttributes(), " extends ");
          for (int j = 0; j < refs.length; j++) {
            generateType(buffer, refs[j], owner, true, useShortNames);
            if (j < refs.length - 1) {
              appendStyledSpan(buffer, getHighlightingManager().getOperationSignAttributes(), " & ");
            }
          }
        }

        if (i < parameters.length - 1) {
          appendStyledSpan(buffer, getHighlightingManager().getCommaAttributes(), ", ");
        }
        if (indent > 0) buffer.append("\n");
      }

      appendStyledSpan(buffer, getHighlightingManager().getOperationSignAttributes(), GT);
      return buffer.toString();
    }

    return "";
  }
String generateTypeParameters(PsiTypeParameterListOwner owner, boolean useShortNames)