private void deleteComments(SpanManager sm){
  int start=0;
  while ((start=sm.indexOf("<!--",start)) != -1) {
    int end=sm.indexOf("-->",start + 4) + 3;
    if (end == -1 + 3) {
      end=sm.length();
    }
    try {
      if (lineSeparator.equals(sm.substring(start - lineSeparator.length(),start)) && lineSeparator.equals(sm.substring(end,end + lineSeparator.length()))) {
        end+=lineSeparator.length();
      }
    }
 catch (    IndexOutOfBoundsException e) {
    }
    sm.delete(start,end);
  }
}

private void deleteComments ( SpanManager sm ) { int start = 0 ; while ( ( start = sm . indexOf ( "<!--" , start ) ) != - 1 ) { int end = sm . indexOf ( "-->" , start + 4 ) + 3 ; if ( end == - 1 + 3 ) { end = sm . length ( ) ; } try { if ( lineSeparator . equals ( sm . substring ( start - lineSeparator . length ( ) , start ) ) && lineSeparator . equals ( sm . substring ( end , end + lineSeparator . length ( ) ) ) ) { end += lineSeparator . length ( ) ; } } catch ( IndexOutOfBoundsException e ) { } sm . delete ( start , end ) ; } }
deleting all comments out of the spanmanager . . . < br / > & lt ! - - comment - - >
