<commit_before>package net.sourceforge.javydreamercsw.mysql.driver;

import java.net.MalformedURLException;
import java.net.URL;
import java.util.logging.Logger;
import org.netbeans.api.db.explorer.DatabaseException;
import org.netbeans.api.db.explorer.JDBCDriver;
import org.netbeans.api.db.explorer.JDBCDriverManager;
import org.openide.modules.ModuleInstall;
import org.openide.util.Exceptions;
import org.openide.windows.WindowManager;

public class Installer extends ModuleInstall {

    public static final String mysqlDriverClass = "com.mysql.jdbc.Driver";
    private static final Logger LOG =
            Logger.getLogger(Installer.class.getCanonicalName());

    @Override
    public void restored() {
        WindowManager.getDefault().invokeWhenUIReady(new Runnable() {
            @Override
            public void run() {
                //Check drivers
                if (JDBCDriverManager.getDefault().getDrivers(mysqlDriverClass).length == 0) {
                    try {
                        LOG.fine("Registering MySQL driver!");
                        JDBCDriverManager.getDefault().addDriver(
                                JDBCDriver.create("mysql", "MySQL",
                                mysqlDriverClass,
                                new URL[]{new URL(
                            "nbinst:/modules/ext/com.validation.manager.mysql/1/mysql/mysql-connector-java.jar")}));
                    } catch (DatabaseException ex) {
                        Exceptions.printStackTrace(ex);
                    } catch (MalformedURLException ex) {
                        Exceptions.printStackTrace(ex);
                    }
                }
            }
        });
    }
}<commit_msg>Use correct driver class as the old one is being deprecated.<commit_after>package net.sourceforge.javydreamercsw.mysql.driver;

import java.net.MalformedURLException;
import java.net.URL;
import java.util.logging.Logger;
import org.netbeans.api.db.explorer.DatabaseException;
import org.netbeans.api.db.explorer.JDBCDriver;
import org.netbeans.api.db.explorer.JDBCDriverManager;
import org.openide.modules.ModuleInstall;
import org.openide.util.Exceptions;
import org.openide.windows.WindowManager;

public class Installer extends ModuleInstall {

    public static final String DRIVER = "com.mysql.cj.jdbc.Driver";
    private static final Logger LOG
            = Logger.getLogger(Installer.class.getCanonicalName());

    @Override
    public void restored() {
        WindowManager.getDefault().invokeWhenUIReady(() -> {
            //Check drivers
            if (JDBCDriverManager.getDefault().getDrivers(DRIVER).length == 0) {
                try {
                    LOG.fine("Registering MySQL driver!");
                    JDBCDriverManager.getDefault().addDriver(
                            JDBCDriver.create("mysql", "MySQL",
                                    DRIVER,
                                    new URL[]{new URL(
                                                "nbinst:/modules/ext/com.validation.manager.mysql/1/mysql/mysql-connector-java.jar")}));
                } catch (DatabaseException | MalformedURLException ex) {
                    Exceptions.printStackTrace(ex);
                }
            }
        });
    }
}
{'fraction_non_alphanumeric': 0.09865196078431372, 'fraction_numerical': 0.0012254901960784314, 'mean_word_length': 1.9817351598173516, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 5, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '684552', 'n_tokens_mistral': 858, 'n_tokens_neox': 823, 'n_words': 146}