<commit_before>package org.almibe.codearea;

import java.util.ArrayList;
import java.util.List;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.concurrent.Worker;
import javafx.scene.web.WebEngine;
import javafx.scene.web.WebView;
import netscape.javascript.JSObject;

public class CodeArea {
    private WebView webView;
    private WebEngine webEngine;
    private List<CodeArea.CodeAreaInitializerListener> initializerListeners = new ArrayList<>();
    
    public CodeArea() {
        super();
        webView = new WebView();        
    }
    
    public void init() {
        final String html = CodeArea.class.getResource("html/editor.html").toExternalForm();
        webEngine = webView.getEngine();
        webEngine.load(html);                
        webEngine.getLoadWorker().stateProperty().addListener(new ChangeListener<Worker.State>() {
            @Override
            public void changed(ObservableValue<? extends Worker.State> observable, Worker.State oldValue, Worker.State newValue) {
                if(newValue == Worker.State.SUCCEEDED) {
                   fireIntializationEvents();
                }
            }
        });
    }
    
    public void addInitializationListener(CodeArea.CodeAreaInitializerListener listener) {
        initializerListeners.add(listener);
    }
    
    private void fireIntializationEvents() {
        for(CodeArea.CodeAreaInitializerListener listener : initializerListeners) {
            listener.onInitialized();
        }<commit_msg>Changing fields to final<commit_after>package org.almibe.codearea;

import java.util.ArrayList;
import java.util.List;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.concurrent.Worker;
import javafx.scene.web.WebEngine;
import javafx.scene.web.WebView;
import netscape.javascript.JSObject;

public class CodeArea {
    private final WebView webView;
    private final WebEngine webEngine;
    private final List<CodeArea.CodeAreaInitializerListener> initializerListeners = new ArrayList<>();
    
    public CodeArea() {
        super();
        webView = new WebView();        
        webEngine = webView.getEngine();
    }
    
    public void init() {
        final String html = CodeArea.class.getResource("html/editor.html").toExternalForm();
        webEngine.load(html);                
        webEngine.getLoadWorker().stateProperty().addListener(new ChangeListener<Worker.State>() {
            @Override
            public void changed(ObservableValue<? extends Worker.State> observable, Worker.State oldValue, Worker.State newValue) {
                if(newValue == Worker.State.SUCCEEDED) {
                   fireIntializationEvents();
                }
            }
        });
    }
    
    public void addInitializationListener(CodeArea.CodeAreaInitializerListener listener) {
        initializerListeners.add(listener);
    }
    
    private void fireIntializationEvents() {
        for(CodeArea.CodeAreaInitializerListener listener : initializerListeners) {
            listener.onInitialized();
        }
{'fraction_non_alphanumeric': 0.09326093899712552, 'fraction_numerical': 0.0, 'mean_word_length': 2.8335373317013466, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '7652132', 'n_tokens_mistral': 824, 'n_tokens_neox': 820, 'n_words': 158}