Buggy code:
public class Message implements Cloneable { public static int MAXLENGTH = 65535 ; private Header header ; private List [ ] sections ; private int size ; private byte [ ] wireFormat ; private TSIG tsigkey ; private TSIGRecord querytsig ; private byte tsigerror ; int tsigstart ; boolean TSIGsigned ; boolean TSIGverified ; private static Record [ ] emptyRecordArray = new Record [ 0 ] ; private static RRset [ ] emptyRRsetArray = new RRset [ 0 ] ; private Message ( Header header ) { } public Message ( int id ) { } public Message ( ) { } public static Message newQuery ( Record r ) { } public static Message newUpdate ( Name zone ) { } Message ( DataByteInputStream in ) throws IOException { } public Message ( byte [ ] b ) throws IOException { } public void setHeader ( Header h ) { } public Header getHeader ( ) { } public void addRecord ( Record r , int section ) { } public boolean removeRecord ( Record r , int section ) { } public void removeAllRecords ( int section ) { } public boolean findRecord ( Record r , int section ) { } public boolean findRecord ( Record r ) { } public boolean findRRset ( Name name , short type , int section ) { } public boolean findRRset ( Name name , short type ) { } public Record getQuestion ( ) { } public TSIGRecord getTSIG ( ) { } public boolean isSigned ( ) { } public boolean isVerified ( ) { } public OPTRecord getOPT ( ) { } public short getRcode ( ) { } public Enumeration getSection ( int section ) { } public Record [ ] getSectionArray ( int section ) { } private static boolean sameSet ( Record r1 , Record r2 ) { } private static boolean sameSet ( RRset set , Record rec ) { } public RRset [ ] getSectionRRsets ( int section ) { } void toWire ( DataByteOutputStream out ) { } private int sectionToWire ( DataByteOutputStream out , int section , Compression c , int maxLength ) { } private boolean toWire ( DataByteOutputStream out , int maxLength ) { } public byte [ ] toWire ( ) { } public byte [ ] toWire ( int maxLength ) { } public void setTSIG ( TSIG key , byte error , TSIGRecord querytsig ) { } public int numBytes ( ) { } public String sectionToString ( int i ) { } public String toString ( ) { StringBuffer sb = new StringBuffer ( ) ; OPTRecord opt = getOPT ( ) ; if ( opt != null ) sb . append ( ( ( header . toStringWithRcode ( getRcode ( ) ) ) + "\n" ) ) ; else sb . append ( ( ( header ) + "\n" ) ) ; if ( isSigned ( ) ) { sb . append ( ";;<seq2seq4repair_space>TSIG<seq2seq4repair_space>" ) ; if ( isVerified ( ) ) sb . append ( "ok" ) ; else sb . append ( "invalid" ) ; sb . append ( '\n' ) ; } for ( int i = 0 ; i < 4 ; i ++ ) { if ( ( header . getOpcode ( ) ) != ( Opcode . UPDATE ) ) sb . append ( ( ( ";;<seq2seq4repair_space>" + ( Section . longString ( i ) ) ) + ":\n" ) ) ; else sb . append ( ( ( ";;<seq2seq4repair_space>" + ( Section . updString ( i ) ) ) + ":\n" ) ) ; sb . append ( ( ( sectionToString ( i ) ) + "\n" ) ) ; } <START_BUG> sb . append ( ( ( ";;<seq2seq4repair_space>done<seq2seq4repair_space>(" + ( numBytes ( ) ) ) + "<seq2seq4repair_space>bytes)" ) ) ; <END_BUG> return sb . toString ( ) ; } public Object clone ( ) { } }

Fix:
sb . append ( ( ( ";;<seq2seq4repair_space>Message<seq2seq4repair_space>size:<seq2seq4repair_space>" + ( numBytes ( ) ) ) + "<seq2seq4repair_space>bytes" ) ) ;