question: static public void appendEscapingCDATA ( final StringBuffer buf , final String str ) { if ( str != null ) { int end = str . indexOf ( CDATA_END ) ; if ( end < 0 ) { buf . append ( str ) ; } else { int start = 0 ; while ( end > - 1 ) { buf . append ( str . substring ( start , end ) ) ; buf . append ( CDATA_EMBEDED_END ) ; start = end + CDATA_END_LEN ; if ( start < str . length ( ) ) { end = str . indexOf ( CDATA_END , start ) ; } else { return ; } } buf . append ( str . substring ( start ) ) ; } } }
target:  Ensures that embeded CDEnd strings (]]>) are handled properly within message, NDC and throwable tag text.