<commit_before>package com.github.to2mbn.jmccc.version;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Objects;
import java.util.Set;
import com.github.to2mbn.jmccc.option.MinecraftDirectory;

public class Version implements Serializable {

    private static final long serialVersionUID = 1L;

    private String version;
    private String mainClass;
    private String assets;
    private String launchArgs;
    private String jarPath;
    private Set<Library> libraries;
    private boolean legacy;

    /**
     * Creates a Version object.
     * 
     * @param version the version number
     * @param mainClass the main class
     * @param assets the assets index name
     * @param launchArgs the launch arguments
     * @param jarPath the relative path of the jar file
     * @param libraries the libraries to add to classpath
     * @param legacy true if this version is lower than 1.7.10, as well as using the legacy assets index
     * @throws NullPointerException if an argument == null
     */
    public Version(String version, String mainClass, String assets, String launchArgs, String jarPath, Set<Library> libraries, boolean legacy) {
        Objects.requireNonNull(version);
        Objects.requireNonNull(mainClass);
        Objects.requireNonNull(assets);
        Objects.requireNonNull(launchArgs);
        Objects.requireNonNull(jarPath);
        Objects.requireNonNull(libraries);
        Objects.requireNonNull(legacy);
        this.version = version;
        this.mainClass = mainClass;
        this.assets = assets;
        this.launchArgs = launchArgs;
        this.jarPath = jarPath;
        this.libraries = libraries;
        this.legacy = legacy;
    }

    /**
     * Gets the version number.
     * 
     * @return the version number
     */
    public String getVersion() {
        return version;
    }

    /**
     * Gets the main class.
     * 
     * @return the main class
     */
    public String getMainClass() {
        return mainClass;
    }

    /**
     * Gets the assets index name.
     * <p>
     * Returns <code>"legacy"</code> if it's a legacy version.
     * 
     * @return the assets index name
     * @see #isLegacy()
     */
    public String getAssets() {
        return assets;
    }

    /**
     * Gets the launch arguments.
     * 
     * @return the launch arguments
     */
    public String getLaunchArgs() {
        return launchArgs;
    }

    /**
     * Returns the relative path of the version.
     * <p>
     * Use '/' as the separator char, and 'versions' as the base dir.
     * 
     * @return the jar file
     */
    public String getJarPath() {
        return jarPath;
    }

    /**
     * Gets the required libraries.
     * 
     * @return the required libraries
     */
    public Set<Library> getLibraries() {
        return libraries;
    }

    /**
     * Returns the missing libraries in the given minecraft directory.
     * 
     * @param minecraftDir the minecraft directory to check
     * @return true the missing libraries in the given minecraft directory, an empty set if no library is missing
     */
    public Set<Library> getMissingLibraries(MinecraftDirectory minecraftDir) {
        Set<Library> missing = new HashSet<>();
        for (Library library : libraries) {
            if (library.isMissing(minecraftDir)) {
                missing.add(library);
            }
        }
        return missing;
    }

    /**
     * Returns true if this version is lower than 1.7.10
     *
     * @return true if this version is lower than 1.7.10, as well as using the legacy assets index
     */
    public boolean isLegacy() {
        return legacy;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == this) {
            return true;
        }
        if (obj instanceof Version) {
            Version another = (Version) obj;
            return version.equals(another.version) && mainClass.equals(another.mainClass) && assets.equals(another.assets) && launchArgs.equals(another.launchArgs) && jarPath.equals(another.jarPath) && libraries.equals(another.libraries) && legacy == another.legacy;
        }
        return false;
    }

    @Override
    public int hashCode() {
        return Objects.hash(version, mainClass, assets, launchArgs, jarPath, libraries, legacy);
    }

    @Override
    public String toString() {
        return version;
    }

}
<commit_msg>remove unnecessary null check. no need for checking basic data type<commit_after>package com.github.to2mbn.jmccc.version;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Objects;
import java.util.Set;
import com.github.to2mbn.jmccc.option.MinecraftDirectory;

public class Version implements Serializable {

    private static final long serialVersionUID = 1L;

    private String version;
    private String mainClass;
    private String assets;
    private String launchArgs;
    private String jarPath;
    private Set<Library> libraries;
    private boolean legacy;

    /**
	 * Creates a Version object.
	 * 
	 * @param version the version number
	 * @param mainClass the main class
	 * @param assets the assets index name
	 * @param launchArgs the launch arguments
	 * @param jarPath the relative path of the jar file
	 * @param libraries the libraries to add to classpath
	 * @param legacy true if this version is lower than 1.7.10, as well as using the legacy assets index
	 * @throws NullPointerException if any of the arguments is null
	 */
    public Version(String version, String mainClass, String assets, String launchArgs, String jarPath, Set<Library> libraries, boolean legacy) {
        Objects.requireNonNull(version);
        Objects.requireNonNull(mainClass);
        Objects.requireNonNull(assets);
        Objects.requireNonNull(launchArgs);
        Objects.requireNonNull(jarPath);
        Objects.requireNonNull(libraries);
        this.version = version;
        this.mainClass = mainClass;
        this.assets = assets;
        this.launchArgs = launchArgs;
        this.jarPath = jarPath;
        this.libraries = libraries;
        this.legacy = legacy;
    }

    /**
     * Gets the version number.
     * 
     * @return the version number
     */
    public String getVersion() {
        return version;
    }

    /**
     * Gets the main class.
     * 
     * @return the main class
     */
    public String getMainClass() {
        return mainClass;
    }

    /**
     * Gets the assets index name.
     * <p>
     * Returns <code>"legacy"</code> if it's a legacy version.
     * 
     * @return the assets index name
     * @see #isLegacy()
     */
    public String getAssets() {
        return assets;
    }

    /**
     * Gets the launch arguments.
     * 
     * @return the launch arguments
     */
    public String getLaunchArgs() {
        return launchArgs;
    }

    /**
     * Returns the relative path of the version.
     * <p>
     * Use '/' as the separator char, and 'versions' as the base dir.
     * 
     * @return the jar file
     */
    public String getJarPath() {
        return jarPath;
    }

    /**
     * Gets the required libraries.
     * 
     * @return the required libraries
     */
    public Set<Library> getLibraries() {
        return libraries;
    }

    /**
     * Returns the missing libraries in the given minecraft directory.
     * 
     * @param minecraftDir the minecraft directory to check
     * @return true the missing libraries in the given minecraft directory, an empty set if no library is missing
     */
    public Set<Library> getMissingLibraries(MinecraftDirectory minecraftDir) {
        Set<Library> missing = new HashSet<>();
        for (Library library : libraries) {
            if (library.isMissing(minecraftDir)) {
                missing.add(library);
            }
        }
        return missing;
    }

    /**
     * Returns true if this version is lower than 1.7.10
     *
     * @return true if this version is lower than 1.7.10, as well as using the legacy assets index
     */
    public boolean isLegacy() {
        return legacy;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == this) {
            return true;
        }
        if (obj instanceof Version) {
            Version another = (Version) obj;
            return version.equals(another.version) && mainClass.equals(another.mainClass) && assets.equals(another.assets) && launchArgs.equals(another.launchArgs) && jarPath.equals(another.jarPath) && libraries.equals(another.libraries) && legacy == another.legacy;
        }
        return false;
    }

    @Override
    public int hashCode() {
        return Objects.hash(version, mainClass, assets, launchArgs, jarPath, libraries, legacy);
    }

    @Override
    public String toString() {
        return version;
    }

}

{'fraction_non_alphanumeric': 0.08890147225368063, 'fraction_numerical': 0.0033975084937712344, 'mean_word_length': 2.2963792459873087, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, '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': '371485', 'n_tokens_mistral': 2441, 'n_tokens_neox': 2339, 'n_words': 772}