private String parseStacktrace ( final String pDescription , final String pStacktraceMD5 ) throws IssueParseException { String stacktrace = null ; // escape braces { and } to use strings in regexp final String start = "<pre class=\"javastacktrace\">" ; final String qStart = Pattern . quote ( start ) ; final String end = "</pre>" ; final String qEnd = Pattern . quote ( end ) ; final Pattern p = Pattern . compile ( qStart + "(.*)" + qEnd , Pattern . DOTALL | Pattern . CASE_INSENSITIVE ) ; final Matcher m = p . matcher ( pDescription ) ; if ( m . find ( ) ) { stacktrace = m . group ( 1 ) ; // if a start tag or an end tag is found in the stacktrace, then there is a problem if ( StringUtils . contains ( stacktrace , start ) || StringUtils . contains ( stacktrace , end ) ) { throw new IssueParseException ( "Invalid stacktrace block" ) ; } } else { throw new IssueParseException ( "0 stacktrace block found in the description" ) ; } return stacktrace ; }
Extracts the bug stacktrace from the description .