<commit_before>package org.jgrades.lic.app.controller;

import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.Node;
import javafx.scene.control.TextField;
import javafx.stage.FileChooser;
import org.jgrades.lic.api.crypto.decrypt.LicenceDecryptionService;
import org.jgrades.lic.api.model.Licence;
import org.jgrades.lic.app.utils.DialogFactory;

import java.io.File;
import java.io.IOException;
import java.util.Optional;

public class OpeningLicenceWindowController {
    @FXML
    private TextField securityDataField;

    @FXML
    private TextField keystoreField;

    @FXML
    private TextField signatureField;

    @FXML
    private TextField licenceField;

    private MainWindowController mainWindowController;
    private LicenceDecryptionService licenceDecryptionService = new LicenceDecryptionService();

    @FXML
    void openLicenceAction(ActionEvent event) {
        try {
            Licence licence = licenceDecryptionService.decrypt(keystoreField.getText(), securityDataField.getText(), licenceField.getText());
            mainWindowController.setLicence(licence, keystoreField.getText(), securityDataField.getText());
            ((Node) (event.getSource())).getScene().getWindow().hide();
        } catch (Exception e) {
            DialogFactory.showExceptionDialog(e);
        }
    }

    @FXML
    void browseLicenceFileAction(ActionEvent event) {
        browse("Choose licence file", event, licenceField);
    }

    @FXML
    void browseSignatureFileAction(ActionEvent event) {
        browse("Choose signature file", event, signatureField);
    }

    @FXML
    void browseKeystoreFileAction(ActionEvent event) {
        browse("Choose keystore file", event, keystoreField);
    }

    @FXML
    void browseSecurityDataFileAction(ActionEvent event) {
        browse("Choose security data file", event, securityDataField);
    }

    private void browse(String title, ActionEvent event, TextField textField) {
        FileChooser fileChooser = new FileChooser();
        fileChooser.setTitle(title);
        File chosenFile = fileChooser.showOpenDialog(((Node) event.getTarget()).getScene().getWindow());
        if (Optional.ofNullable(chosenFile).isPresent()) {
            textField.setText(chosenFile.getAbsolutePath());
        }
    }

    public void init(MainWindowController mainWindowController) {
        this.mainWindowController = mainWindowController;
    }

    public void verifySignature() {
        try {
            boolean validationSuccess = licenceDecryptionService.validSignature(keystoreField.getText(),
                    securityDataField.getText(), licenceField.getText(), signatureField.getText());
            if (validationSuccess) {
                DialogFactory.showInformationDialog("Signature is valid");
            } else {
                DialogFactory.showWarningDialog("Signature is not valid");
            }
        } catch (IOException e) {
            DialogFactory.showExceptionDialog(e);
        }
    }
}<commit_msg>Force coveralls update by changing any of code<commit_after>package org.jgrades.lic.app.controller;

import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.Node;
import javafx.scene.control.TextField;
import javafx.stage.FileChooser;
import org.jgrades.lic.api.crypto.decrypt.LicenceDecryptionService;
import org.jgrades.lic.api.model.Licence;
import org.jgrades.lic.app.utils.DialogFactory;

import java.io.File;
import java.io.IOException;
import java.util.Optional;

public class OpeningLicenceWindowController {
    private static final String SIGNATURE_IS_VALID = "Signature is valid";
    private static final String SIGNATURE_IS_NOT_VALID = "Signature is not valid";

    @FXML
    private TextField securityDataField;

    @FXML
    private TextField keystoreField;

    @FXML
    private TextField signatureField;

    @FXML
    private TextField licenceField;

    private MainWindowController mainWindowController;
    private LicenceDecryptionService licenceDecryptionService = new LicenceDecryptionService();

    @FXML
    void openLicenceAction(ActionEvent event) {
        try {
            Licence licence = licenceDecryptionService.decrypt(keystoreField.getText(), securityDataField.getText(), licenceField.getText());
            mainWindowController.setLicence(licence, keystoreField.getText(), securityDataField.getText());
            ((Node) (event.getSource())).getScene().getWindow().hide();
        } catch (Exception e) {
            DialogFactory.showExceptionDialog(e);
        }
    }

    @FXML
    void browseLicenceFileAction(ActionEvent event) {
        browse("Choose licence file", event, licenceField);
    }

    @FXML
    void browseSignatureFileAction(ActionEvent event) {
        browse("Choose signature file", event, signatureField);
    }

    @FXML
    void browseKeystoreFileAction(ActionEvent event) {
        browse("Choose keystore file", event, keystoreField);
    }

    @FXML
    void browseSecurityDataFileAction(ActionEvent event) {
        browse("Choose security data file", event, securityDataField);
    }

    private void browse(String title, ActionEvent event, TextField textField) {
        FileChooser fileChooser = new FileChooser();
        fileChooser.setTitle(title);
        File chosenFile = fileChooser.showOpenDialog(((Node) event.getTarget()).getScene().getWindow());
        if (Optional.ofNullable(chosenFile).isPresent()) {
            textField.setText(chosenFile.getAbsolutePath());
        }
    }

    public void init(MainWindowController mainWindowController) {
        this.mainWindowController = mainWindowController;
    }

    public void verifySignature() {
        try {
            boolean validationSuccess = licenceDecryptionService.validSignature(keystoreField.getText(),
                    securityDataField.getText(), licenceField.getText(), signatureField.getText());
            if (validationSuccess) {
                DialogFactory.showInformationDialog(SIGNATURE_IS_VALID);
            } else {
                DialogFactory.showWarningDialog(SIGNATURE_IS_NOT_VALID);
            }
        } catch (IOException e) {
            DialogFactory.showExceptionDialog(e);
        }
    }
}
{'fraction_non_alphanumeric': 0.09225329476052717, 'fraction_numerical': 0.0, 'mean_word_length': 3.3487071977638014, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '4632958', 'n_tokens_mistral': 1716, 'n_tokens_neox': 1609, 'n_words': 333}