question: public void addIncrement ( String text ) throws BadLocationException { if ( text == null || text . length ( ) == 0 || text . equals ( "\n" ) ) { return ; } else if ( text . charAt ( text . length ( ) - 1 ) != 10 ) { throw new BadLocationException ( "Input does not end with newline" ) ; } document . replace ( document . getLength ( ) , 0 , text ) ; }
target:  add the increment The argument should be a relatively short string, i.e. no more than what TLC prints out in a single instant. It is also better if when at least one TLC end tag is part of the string passed to this method, the string terminates with a TLC end tag.