<commit_before>package org.apache.fop.fo;

import java.util.Iterator;
import java.util.ListIterator;
import java.util.NoSuchElementException;


public class RecursiveCharIterator extends AbstractCharIterator {
    Iterator childIter = null; // Child flow objects
    CharIterator curCharIter = null; // Children's characters
    private FONode fobj;
    private FONode curChild;

    public RecursiveCharIterator(FObj fobj) {
	// Set up first child iterator
	this.fobj = fobj;
	this.childIter = fobj.getChildren();
	getNextCharIter();
    }

    public RecursiveCharIterator(FObj fobj, FONode child) {
	// Set up first child iterator
	this.fobj = fobj;
	this.childIter = fobj.getChildren(child);
	getNextCharIter();
    }

    public CharIterator mark() {
	return (CharIterator) this.clone();
    }

    public Object clone() {
	RecursiveCharIterator ci = (RecursiveCharIterator)super.clone();
	ci.childIter = fobj.getChildren(ci.curChild);
	ci.curCharIter = (CharIterator)curCharIter.clone();
	return ci;
    }<commit_msg>Fix a small bug in iterator<commit_after>package org.apache.fop.fo;

import java.util.Iterator;
import java.util.ListIterator;
import java.util.NoSuchElementException;


public class RecursiveCharIterator extends AbstractCharIterator {
    Iterator childIter = null; // Child flow objects
    CharIterator curCharIter = null; // Children's characters
    private FONode fobj;
    private FONode curChild;

    public RecursiveCharIterator(FObj fobj) {
	// Set up first child iterator
	this.fobj = fobj;
	this.childIter = fobj.getChildren();
	getNextCharIter();
    }

    public RecursiveCharIterator(FObj fobj, FONode child) {
	// Set up first child iterator
	this.fobj = fobj;
	this.childIter = fobj.getChildren(child);
	getNextCharIter();
    }

    public CharIterator mark() {
	return (CharIterator) this.clone();
    }

    public Object clone() {
	RecursiveCharIterator ci = (RecursiveCharIterator)super.clone();
	ci.childIter = fobj.getChildren(ci.curChild);
	// Need to advance to the next child, else we get the same one!!!
	ci.childIter.next();
	ci.curCharIter = (CharIterator)curCharIter.clone();
	return ci;
    }
{'fraction_non_alphanumeric': 0.10004653327128897, 'fraction_numerical': 0.0, 'mean_word_length': 4.155875299760192, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5318423', 'n_tokens_mistral': 681, 'n_tokens_neox': 665, 'n_words': 171}