<commit_before>package co.phoenixlab.dn.dngearsim.bootstrap;

import javafx.beans.binding.Bindings;
import javafx.concurrent.Task;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.layout.AnchorPane;
import javafx.scene.shape.Rectangle;

public class BootstrapUiController {

    @FXML
    private AnchorPane pane;

    @FXML
    private Rectangle loadingBar;

    @FXML
    private Label statusText;

    @FXML
    private Button exitBtn;

    private Runnable exitBtnAction;

    @FXML
    void initialize() {
        assert pane != null : "fx:id=\"pane\" was not injected: check your FXML file 'splash.fxml'.";
        assert loadingBar != null : "fx:id=\"loadingBar\" was not injected: check your FXML file 'splash.fxml'.";
        assert statusText != null : "fx:id=\"statusText\" was not injected: check your FXML file 'splash.fxml'.";

    }

    public void bindToTask(Task<?> task) {
        assert task != null : "Task cannot be null, check invocation site";
        statusText.textProperty().
                bind(task.messageProperty());
        loadingBar.widthProperty().
                bind(Bindings.multiply(pane.widthProperty(), task.progressProperty()));
    }

    public void unbind() {
        statusText.textProperty().unbind();
        loadingBar.widthProperty().unbind();
    }

    public void setOnExitButtonAction(Runnable runnable) {
        exitBtnAction = runnable;
    }

    @FXML
    private void onExitBtnPressed(ActionEvent event) {
        if (exitBtnAction != null) {
            exitBtnAction.run();
        }
    }
}
<commit_msg>Keep hard reference to the binding<commit_after>package co.phoenixlab.dn.dngearsim.bootstrap;

import javafx.beans.binding.Bindings;
import javafx.beans.binding.NumberBinding;
import javafx.concurrent.Task;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.layout.AnchorPane;
import javafx.scene.shape.Rectangle;

public class BootstrapUiController {

    @FXML
    private AnchorPane pane;

    @FXML
    private Rectangle loadingBar;

    @FXML
    private Label statusText;

    @FXML
    private Button exitBtn;

    private Runnable exitBtnAction;
    private NumberBinding barWidthBinding;

    @FXML
    void initialize() {
        assert pane != null : "fx:id=\"pane\" was not injected: check your FXML file 'splash.fxml'.";
        assert loadingBar != null : "fx:id=\"loadingBar\" was not injected: check your FXML file 'splash.fxml'.";
        assert statusText != null : "fx:id=\"statusText\" was not injected: check your FXML file 'splash.fxml'.";

    }

    public void bindToTask(Task<?> task) {
        assert task != null : "Task cannot be null, check invocation site";
        statusText.textProperty().
                bind(task.messageProperty());
        barWidthBinding = Bindings.multiply(pane.widthProperty(), task.progressProperty());
        loadingBar.widthProperty().
                bind(barWidthBinding);
    }

    public void unbind() {
        statusText.textProperty().unbind();
        loadingBar.widthProperty().unbind();
    }

    public void setOnExitButtonAction(Runnable runnable) {
        exitBtnAction = runnable;
    }

    @FXML
    private void onExitBtnPressed(ActionEvent event) {
        if (exitBtnAction != null) {
            exitBtnAction.run();
        }
    }
}

{'fraction_non_alphanumeric': 0.10757314974182444, 'fraction_numerical': 0.0, 'mean_word_length': 3.0034443168771525, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 8}, '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': '1895204', 'n_tokens_mistral': 1046, 'n_tokens_neox': 1005, 'n_words': 250}