<commit_before>package org.vaadin.teemu.clara;

import java.io.IOException;
import java.io.InputStream;

import org.vaadin.teemu.clara.factory.ComponentManager;
import org.vaadin.teemu.clara.factory.ComponentInstantiationException;
import org.vaadin.teemu.clara.factory.DefaultComponentManager;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.XMLReader;
import org.xml.sax.helpers.XMLReaderFactory;

public class LayoutInflater {

    private ComponentManager componentManager = new DefaultComponentManager();

    public void setComponentFactory(ComponentManager componentManager) {
        this.componentManager = componentManager;
    }

    public InflatedCustomComponent inflate(InputStream xml)
            throws LayoutInflaterException {
        try {
            // initialize content handler
            LayoutInflaterContentHandler handler = new LayoutInflaterContentHandler(
                    componentManager);

            // parse the XML
            XMLReader parser = XMLReaderFactory.createXMLReader();
            parser.setContentHandler(handler);<commit_msg>Fixed a setter name in LayoutInflater.<commit_after>package org.vaadin.teemu.clara;

import java.io.IOException;
import java.io.InputStream;

import org.vaadin.teemu.clara.factory.ComponentManager;
import org.vaadin.teemu.clara.factory.ComponentInstantiationException;
import org.vaadin.teemu.clara.factory.DefaultComponentManager;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.XMLReader;
import org.xml.sax.helpers.XMLReaderFactory;

public class LayoutInflater {

    private ComponentManager componentManager = new DefaultComponentManager();

    public void setComponentManager(ComponentManager componentManager) {
        this.componentManager = componentManager;
    }

    public InflatedCustomComponent inflate(InputStream xml)
            throws LayoutInflaterException {
        try {
            // initialize content handler
            LayoutInflaterContentHandler handler = new LayoutInflaterContentHandler(
                    componentManager);

            // parse the XML
            XMLReader parser = XMLReaderFactory.createXMLReader();
            parser.setContentHandler(handler);
{'fraction_non_alphanumeric': 0.07215582115980522, 'fraction_numerical': 0.0, 'mean_word_length': 3.6597938144329896, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 10}, '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': '3226514', 'n_tokens_mistral': 594, 'n_tokens_neox': 557, 'n_words': 116}