private final boolean handleMismatch() { boolean backTrack = (this.rewriter().backTrackOnMismatch() && this.state().hasBufferContents()); if (backTrack) { // swallow the first operation which represented a false start this.state().write(this.state().debuffer()); // Now, try again... // Take the buffered operations & reset the state to process them again List<JvmOperation> prevBuffer = this.state().takeBuffer(); this.state().resetState(false); // ..., by walking through the buffered operations, calling back on this filter for (JvmOperation bufferedOp : prevBuffer) { bufferedOp.process(this.rewritingFilter); } } else { // no back tracking - just flush the buffer & reset this.state().flushBuffer(); this.state().resetState(false); } return backTrack; }
public final void flushBuffer() { for (JvmOperation op : this.buffer) { op.process(this.processor()); } }
public final void write(final JvmOperation operation) { operation.process(this.processor()); }