/*
Get summary trace line for this message

Javadoc description supplied by ControlMessage interface.
776416
public void getTraceSummaryLine(StringBuilder buff) {
    
    // Get the common fields for control messages
    super.getTraceSummaryLine(buff);
    
    buff.append(",requestID=");
    buff.append(getRequestID());
    
    buff.append(",durableSubName=");
    buff.append(getDurableSubName());
    
    buff.append(",securityUserid=");
    buff.append(getSecurityUserid());
        
  }
1177257
public void getTraceSummaryLine(StringBuilder buff) {
    
    // Get the common fields for control messages
    super.getTraceSummaryLine(buff);
    
    buff.append(",ackPrefix=");
    buff.append(getAckPrefix());
    
  }
484575
public void getTraceSummaryLine(StringBuilder buff) {
    
    // Get the common fields for control messages
    super.getTraceSummaryLine(buff);
    
    buff.append(",browseID=");
    buff.append(getBrowseID());
    
    buff.append(",exceptionCode=");
    buff.append(getExceptionCode());
    
  }
1143060
public String summarize()
    {
        return String.format(SUMMARY_FORMAT,
                action, clientId, subject, existent, usable,
                sufficient, refreshable, expiresAt,
                Utils.join(scopes, " "),
                Utils.stringifyProperties(properties),
                clientIdAlias, clientIdAliasUsed,
                certificateThumbprint);
    }
880241
public String getMessage()
    {
        String trace;
        if ( node != null )
            trace = " : at Line: "+ node.getLineNumber()
                + " : in file: "+ node.getSourceFile()
                + " : "+node.getText();
        else
            // Users should not normally see this.
            trace = ": <at unknown location>";

        if ( callstack != null )
            trace = trace +"\n" + getScriptStackTrace();

        return getRawMessage() + trace;
    }
1097825
def get_summary_string(self):
        
        from rez.plugin_managers import plugin_manager

        txt = "Rez %s" % __version__
        txt += "\n\n%s" % plugin_manager.get_summary_string()
        return txt
1177504
protected String getDescription(final DocWorkUnit currentWorkUnit) {
        return Arrays.stream(currentWorkUnit.getClassDoc().inlineTags())
                .filter(t -> getTagPrefix() == null || !t.name().startsWith(getTagPrefix()))
                .map(t -> t.text())
                .collect(Collectors.joining());
    }
718319
public static String getStackTrace(Throwable throwable, boolean isHtmlStyle) {
        AssertHelper.notNull(throwable, "throwable can't be null.");
        String line = isHtmlStyle ? "<br/>" : "\r\n";
        String tab = isHtmlStyle ? "&nbsp;&nbsp;&nbsp;&nbsp;" : "\t";
        while (throwable instanceof NiubiException) {
            throwable = throwable.getCause();
        }
        StringBuffer stringBuffer = new StringBuffer(throwable.getClass().getName()).append(":");
        if (throwable.getMessage() != null) {
            stringBuffer.append(throwable.getMessage()).append(line);
        } else {
            stringBuffer.append(line);
        }
        try {
            StackTraceElement[] stackElements = throwable.getStackTrace();
            if (stackElements != null) {
                for (int i = 0; i < stackElements.length && i < MAX_STACK_TRACE_DEEP; i++) {
                    stringBuffer.append(tab);
                    stringBuffer.append(stackElements[i].getClassName()).append('.');
                    stringBuffer.append(stackElements[i].getMethodName()).append('(');
                    stringBuffer.append(stackElements[i].getFileName()).append(':');
                    stringBuffer.append(stackElements[i].getLineNumber()).append(')');
                    stringBuffer.append(line);
                }
            }
        } catch (Exception e) {
            //ignored
        }
        if (isHtmlStyle) {
            return stringBuffer.length() > MAX_LENGTH ? (stringBuffer.substring(0, stringBuffer.lastIndexOf(line)) + DEFAULT_END_STRING) : stringBuffer.toString();
        } else {
            return stringBuffer.length() > MAX_LENGTH ? (stringBuffer.substring(0, MAX_LENGTH) + DEFAULT_END_STRING) : stringBuffer.toString();
        }
    }
72421
public void getTraceSummaryLine(StringBuilder buff) {
    super.getTraceSummaryLine(buff);
    
    buff.append(",trmMsgType=");
    buff.append(getTrmMessageType());
    
    buff.append(",magicNumber=");
    buff.append(getMagicNumber());
    
  }
723923
public static String getTotalStackTrace( final Throwable    exception )
    {
        if( isBroadestFirst() )
        {
            StringWriter    writer = new StringWriter();
            exception.printStackTrace( new PrintWriter( writer, true ) );

            return writer.toString();
        }

        //
        //     Reverse the order of the exceptions
        //
        List<Throwable>    exceps = new ArrayList<Throwable>();
        Throwable    rev = exception;

        while ( rev != null && rev.getCause() != rev )
        {
            exceps.add( 0, rev );

            rev = rev.getCause();
        }

        StringBuffer   buffer = new StringBuffer();

        for ( int ii = 0; ii < exceps.size(); ii++ )
        {
            Throwable    ex = exceps.get( ii );
            Throwable    parent = null;
            if ( ii != 0 )
            {
                buffer.append( "\n\nIn context of:\n" );
                parent = exceps.get( ii -1 );
            }

            buffer.append( ex.toString() );
            StackTraceElement[]    trace = ex.getStackTrace();
            for ( int jj=0; jj < trace.length; jj++)
            {
                StackTraceElement    traceElement = trace[jj];

                boolean    done = false;
                if ( parent != null )
                {
                    StackTraceElement[]    parentTrace = parent.getStackTrace();
                    for ( int kk=0; kk < parentTrace.length; kk++ )
                    {
                        if ( parentTrace[kk].equals( traceElement ) )
                        {
                            done = true;
                            break;
                        }
                    }
                }

                buffer.append("\n\tat " + traceElement );

                if ( done )
                {
                    buffer.append( "\n\t..." );
                    break;
                }
            }
        }

        return buffer.toString();
    }
171774
private String getDetails(Throwable error) {
		if (null == error) {
			return "";
		}
		StringBuilder content = new StringBuilder();
		content.append(error.getMessage());
		processStackTrace(error.getStackTrace(), content);
		content.append(getDetails(error.getCause()));
		return content.toString();
	}
426915
@Nonnull
    public String getMessageWithoutPrefix() {
        BugPattern bugPattern = getBugPattern();
        String pattern, shortPattern;

        pattern = getLongDescription();
        shortPattern = bugPattern.getShortDescription();
        try {
            FindBugsMessageFormat format = new FindBugsMessageFormat(pattern);
            return format.format(annotationList.toArray(new BugAnnotation[annotationList.size()]), getPrimaryClass());
        } catch (RuntimeException e) {
            AnalysisContext.logError("Error generating bug msg ", e);
            return shortPattern + " [Error generating customized description]";
        }
    }
881140
private String getDetailsAsHTML(String title, Level level, Throwable e) {
        if (e != null) {
            // convert the stacktrace into a more pleasent bit of HTML
            StringBuffer html = new StringBuffer("<html>");
            html.append("<h2>" + escapeXml(title) + "</h2>");
            html.append("<HR size='1' noshade>");
            html.append("<div></div>");
            html.append("<b>Message:</b>");
            html.append("<pre>");
            html.append("    " + escapeXml(e.toString()));
            html.append("</pre>");
            html.append("<b>Level:</b>");
            html.append("<pre>");
            html.append("    " + level);
            html.append("</pre>");
            html.append("<b>Stack Trace:</b>");
            html.append("<pre>");
            for (StackTraceElement el : e.getStackTrace()) {
                html.append("    " + el.toString().replace("<init>", "&lt;init&gt;") + "\n");
            }
            if (e.getCause() != null) {
                html.append("</pre>");
                html.append("<b>Cause:</b>");
                html.append("<pre>");
                html.append(e.getCause().getMessage());
                html.append("</pre><pre>");
                for (StackTraceElement el : e.getCause().getStackTrace()) {
                    html.append("    " + el.toString().replace("<init>", "&lt;init&gt;") + "\n");
                }
            }
            html.append("</pre></html>");
            return html.toString();
        } else {
            return null;
        }
    }
252957
public static String getProblemMessage(Object object, String summary) {
        return getProblemMessage( object, summary, DEFAULT_SEPARATOR );
    }
518744
private String getDocumentText()
    {
        try
        {
            Document document = textComponent.getDocument();
            String text = document.getText(0, document.getLength());
            return text;
        }
        catch (BadLocationException e)
        {
            logger.warning(e.toString());
            return textComponent.getText();
        }
    }
464141
public String debug()
  {
    String data = null;
    
    StringBuffer sb = new StringBuffer();
    
    sb.append("ConsumerProperties");
    sb.append("\n");
    sb.append("------------------");
    sb.append("\n");
    
    sb.append("Destination: ");
    sb.append(getJmsDestination());
    sb.append("\n");
    
    sb.append("DestType: ");
    sb.append(getDestinationType());
    sb.append("\n");
    
    sb.append("Selector: ");
    sb.append(getSelector());
    sb.append("\n");
    
    sb.append("NoLocal: ");
    sb.append(noLocal());
    sb.append("\n");
    
    sb.append("Reliablity: ");
    sb.append(getReliability());
    sb.append("\n");
    
    sb.append("ClientID: ");
    sb.append(getClientID());
    sb.append("\n");
    
    sb.append("SubName: ");
    sb.append(getSubName());
    sb.append("\n");
    
    sb.append("DurableSubHome: ");
    sb.append(getDurableSubscriptionHome());
    sb.append("\n");
    
    sb.append("ReadAhead: ");
    sb.append(readAhead());
    sb.append("\n");
    
    sb.append("UnrecoverableReliability: ");
    sb.append(getUnrecovReliability());
    sb.append("\n");
    
    sb.append("Supports Multiple: ");
    sb.append(supportsMultipleConsumers());
    sb.append("\n");
    
    if (dest instanceof Queue)
    {
      sb.append("GatherMessages: ");
      sb.append(isGatherMessages());
      sb.append("\n");
      
    }
    
    data = sb.toString();
    return data;    
   
  }
33464
private String getStackTraceHtml(Throwable cause) {
        StringBuilder stackTraceBuilder = new StringBuilder();
        stackTraceBuilder.append(cause.getClass().getName())
                        .append(": ")
                        .append(cause.getMessage())
                        .append("\n ");
        for (int i = 0; i < cause.getStackTrace().length; i++) {
            stackTraceBuilder.append("\n\t at ");
            stackTraceBuilder.append(cause.getStackTrace()[i]);
        }
        
        return "<tr><td colspan=\"2\">" +
        		"<div class=\"error-detail\"><pre>" + stackTraceBuilder.toString() + 
        		"</pre>" + getCodeSnippetHtml(cause) + "</div></td></tr>";
    }