question: void ensureOwnTermBytes ( ) { NRCell cell0 = cellsByLevel [ 0 ] ; if ( cell0 . termBuf == null ) return ; System . arraycopy ( term . bytes , term . offset , cell0 . termBuf , 0 , term . length ) ; term . bytes = cell0 . termBuf ; term . offset = 0 ; cell0 . termBuf = null ; }
target:  Ensure we own term.bytes so that it's safe to modify. We detect via a kluge in which cellsByLevel[0].termBuf is non-null, which is a pre-allocated for use to replace term.bytes. 