/*
Get summary trace line for this message

Javadoc description supplied by ControlMessage interface.
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());
    
  }
297891
public String getDebugMessageAsHTML()
    {
        Throwable rootEx = getRootCause();
        if (isApplicationError(rootEx, "com.ibm.ws.webcontainer"))
        {
            String trimmedStackHtml = ApplicationErrorUtils.getTrimmedStackHtml(rootEx);
            return trimmedStackHtml;
        }
        else
            return "Error " + getErrorCode() + ": " + getMessage();   
    }
1117821
public static String getLine(JUnitTestData testMethod) {
        String line = "~";
        Throwable testException = testMethod.getFailException();
        if (testException != null) {
            StringBuilder lookFor = new StringBuilder();
            lookFor.append(extractClassName(testMethod.getDescription()));
            lookFor.append('.');
            lookFor.append(extractMethodName(testMethod.getDescription()));
            lookFor.append('(');
            lookFor.append(extractSimpleClassName(testMethod.getDescription()));
            lookFor.append(".java:");

            StackTraceElement[] els = testException.getStackTrace();

            for (int i = 0; i < els.length; i++) {
                StackTraceElement el = els[i];
                line = getLineNumberFromExceptionTraceLine(el.toString(),
                                                           lookFor.toString());
                if (line.equals("") == Boolean.FALSE) {
                    break;
                }
            }
        }
        return line;
    }
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;    
   
  }
45379
protected String getDetailedErrorMessage(String message) {
		StringBuilder sb = new StringBuilder(message).append("\n");
		sb.append("HandlerMethod details: \n");
		sb.append("Bean [").append(getBeanType().getName()).append("]\n");
		sb.append("Method [").append(getBridgedMethod().toGenericString()).append("]\n");
		return sb.toString();
	}
472371
private String getStackTrace(final Throwable exception) {

        if (exception != null) {

            StringBuilder sb = new StringBuilder();

            StackTraceElement[] stackTrace = exception.getStackTrace();
            for (StackTraceElement element : stackTrace) {
                sb.append(element.toString());
                sb.append('\n');
            }

            if (exception.getCause() != null) {

                StackTraceElement[] stackTraceCause = exception.getCause().getStackTrace();
                for (StackTraceElement element : stackTraceCause) {
                    sb.append(element.toString());
                    sb.append('\n');
                }

            }

            return sb.toString();
        }

        return null;
    }
820338
private void showDescription() {
        if (service.isVerbose()) {
            String description = getTranslet().getDescription();
            if (description != null) {
                console.writeLine(description);
            }
        }
    }
701787
public void getTraceSummaryLine(StringBuilder buff) {
    
    // Get the common fields for control messages
    super.getTraceSummaryLine(buff);
    
    buff.append("requestID=");
    buff.append(getRequestID());
    
  }
1290543
public static String getDescription(Class<?> comp, Locale loc) {
        Description descr = (Description) comp.getAnnotation(Description.class);
        if (descr != null) {
            String lang = loc.getLanguage();
            Method[] m = descr.getClass().getMethods();
            for (Method method : m) {
//                System.out.println(method);
                if (method.getName().equals(lang)) {
                    try {
                        String d = (String) method.invoke(descr, (Object[]) null);
                        if (d != null && !d.isEmpty()) {
                            return d;
                        }
                    } catch (Exception ex) {
                        ex.printStackTrace();
                    }
                }
            }
            return descr.value();
        }
        return null;
    }
248279
public void getTraceSummaryLine(StringBuilder buff) {
    
    // Get the common fields for control messages
    super.getTraceSummaryLine(buff);
    
    buff.append("requestID=");
    buff.append(getRequestID());
    
    buff.append("indoubtDiscard=");
    buff.append(getIndoubtDiscard());
    
  }
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();
    }
1333748
public String getMessage()
  {

    String lastMessage = super.getMessage();
    Throwable exception = m_exception;

    while (null != exception)
    {
      String nextMessage = exception.getMessage();

      if (null != nextMessage)
        lastMessage = nextMessage;

      if (exception instanceof TransformerException)
      {
        TransformerException se = (TransformerException) exception;
        Throwable prev = exception;

        exception = se.getException();

        if (prev == exception)
          break;
      }
      else
      {
        exception = null;
      }
    }

    return (null != lastMessage) ? lastMessage : "";
  }
385316
public String getStacktrace() {

        String stacktrace = CmsException.getStackTraceAsString(getLoginException());
        stacktrace = CmsEncoder.escapeXml(stacktrace);
        return stacktrace;
    }
407500
public String summarize()
    {
        return String.format(SUMMARY_FORMAT,
            action, clientId, subject,
            Utils.join(scopes, " "),
            Utils.join(claims, " "),
            token,
            Utils.stringifyProperties(properties),
            clientIdAlias,
            clientIdAliasUsed);
    }
1227276
public static String getBacktrace(JUnitTestData testMethod) {
        StringBuilder stackTrace = new StringBuilder();

        Throwable throwable = testMethod.getFailException();

        if (throwable != null) {
            StringWriter sw = new StringWriter();
            PrintWriter pw = new PrintWriter(sw);
            throwable.printStackTrace(pw);
            String stackTraceString = sw.toString();
            stackTraceString = stackTraceString.trim().replaceAll("\\r\\n",
                    "\n");

            StringTokenizer st = new StringTokenizer(stackTraceString,
                    LINE_SEPARATOR);

            while (st.hasMoreTokens()) {
                String stackTraceLine = st.nextToken();
                stackTrace.append(stackTraceLine);
                stackTrace.append(LINE_SEPARATOR);
            }

        } else {
            stackTrace.append('~');
        }

        return stackTrace.toString();
    }
72421
public void getTraceSummaryLine(StringBuilder buff) {
    super.getTraceSummaryLine(buff);
    
    buff.append(",trmMsgType=");
    buff.append(getTrmMessageType());
    
    buff.append(",magicNumber=");
    buff.append(getMagicNumber());
    
  }
27092
public static String traceText(Throwable exception) {
        final StackTraceWriter writer = new StackTraceWriter();
        exception.printStackTrace(writer);
        return writer.toString();
    }