String () { String type = myReturnTypeCodeFragment != null ? myReturnTypeCodeFragment.getText().trim() : ""; StringBuilder builder = new StringBuilder(); builder.append(myVisibilityPanel.getVisibility()).append(' '); if (!type.isEmpty()) { builder.append(type).append(' '); } builder.append(GrChangeSignatureUtil.getNameWithQuotesIfNeeded(getMethodName(), getProject())); builder.append('('); final List<GrParameterInfo> infos = getParameters(); if (!infos.isEmpty()) { final List<String> paramsText = ContainerUtil.map(infos, info -> generateParameterText(info)); builder.append("\n").append(INDENT); builder.append(StringUtil.join(paramsText, ",\n" + INDENT)); builder.append('\n'); } builder.append(')'); final PsiTypeCodeFragment[] exceptions = myExceptionsModel.getTypeCodeFragments(); if (exceptions.length > 0) { builder.append("\nthrows\n"); final List<String> exceptionNames = ContainerUtil.map(exceptions, fragment -> fragment.getText()); builder.append(INDENT).append(StringUtil.join(exceptionNames, ",\n" + INDENT)); } return builder.toString(); }