<commit_before>package at.yawk.javap

data class RemoteFile(
        val url: String,
        val md5: String? = null,
        val sha256: String? = null,
        val sha512: String? = null
)

sealed class Sdk(
        val language: SdkLanguage
) {
    abstract val name: String

    /**
     * Previous SDK names that should now be treated as this SDK
     */
    open val aliases: Set<String>
        get() = emptySet()

    interface HasLint {
        val supportedWarnings: Set<String>
    }

    interface Java : HasLint {
        val release: Int
    }

    data class OpenJdk(
            override val release: Int,

            override val name: String,
            val distribution: RemoteFile,
            val lombok: RemoteFile,
            val libPaths: Set<String>,
            override val supportedWarnings: Set<String>,

            override val aliases: Set<String> = emptySet()
    ) : Sdk(SdkLanguage.JAVA), Java

    data class Ecj(
            override val release: Int,

            override val name: String,
            val compilerJar: RemoteFile,
            val lombok: RemoteFile,
            val hostJdk: OpenJdk,
            override val supportedWarnings: Set<String>,

            override val aliases: Set<String> = emptySet()
    ) : Sdk(SdkLanguage.JAVA), Java

    interface Kotlin {
        val release: KotlinVersion
    }

    data class KotlinJar(
            override val release: KotlinVersion,
            override val name: String,
            val compilerJar: RemoteFile,
            val hostJdk: OpenJdk
    ) : Sdk(SdkLanguage.KOTLIN), Kotlin

    data class KotlinDistribution(
            override val release: KotlinVersion,
            override val name: String,
            val distribution: RemoteFile,
            val hostJdk: OpenJdk,
            val coroutines: RemoteFile
    ) : Sdk(SdkLanguage.KOTLIN), Kotlin

    data class Scala(
            val release: KotlinVersion,
            override val name: String,
            val sdk: RemoteFile,
            val hostJdk: OpenJdk,
            override val supportedWarnings: Set<String>
    ) : Sdk(SdkLanguage.SCALA), HasLint
}

object Sdks {
    private val lombok1_18_10 = RemoteFile("https://repo1.maven.org/maven2/org/projectlombok/lombok/1.18.10/lombok-1.18.10.jar")
    private val lombok1_18_4 = RemoteFile("https://repo1.maven.org/maven2/org/projectlombok/lombok/1.18.4/lombok-1.18.4.jar")

    private val openjdk6 = Sdk.OpenJdk(
            6,
            name = "OpenJDK 6u79",
            distribution = RemoteFile(
                    "http://cdn.azul.com/zulu/bin/zulu6.12.0.2-jdk6.0.79-linux_x64.tar.gz",
                    md5 = "a54fb082c89de3909df5b69cd50a2155"
            ),
            libPaths = setOf("lib/amd64", "lib/amd64/jli"),
            lombok = lombok1_18_4,
            supportedWarnings = setOf(
                    "cast", "deprecation", "divzero", "empty", "unchecked", "fallthrough", "path", "serial",
                    "finally", "overrides")
    )
    private val openjdk7 = Sdk.OpenJdk(
            7,
            name = "OpenJDK 7u101",
            distribution = RemoteFile(
                    "http://cdn.azul.com/zulu/bin/zulu7.14.0.5-jdk7.0.101-linux_x64.tar.gz",
                    md5 = "6fd6af8bc9a696116b7eeff8d28b0e98"
            ),
            libPaths = setOf("lib/amd64", "lib/amd64/jli"),
            lombok = lombok1_18_4,
            supportedWarnings = openjdk6.supportedWarnings + setOf(
                    "classfile", "dep-ann", "options", "processing", "rawtypes", "static", "try", "varargs")
    )
    private val openjdk8 = Sdk.OpenJdk(
            8,
            name = "OpenJDK 8",
            aliases = setOf("OpenJDK 8u92"),
            distribution = RemoteFile(
                    "https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u252-b09/OpenJDK8U-jdk_x64_linux_hotspot_8u252b09.tar.gz",
                    sha256 = "2b59b5282ff32bce7abba8ad6b9fde34c15a98f949ad8ae43e789bbd78fc8862"
            ),
            libPaths = setOf("lib/amd64", "lib/amd64/jli"),
            lombok = lombok1_18_4,
            supportedWarnings = openjdk7.supportedWarnings + setOf("auxiliaryclass", "overloads")
    )
    private val openjdk9 = Sdk.OpenJdk(
            9,
            name = "OpenJDK 9",
            aliases = setOf("OpenJDK 9.0.0"),
            distribution = RemoteFile(
                    "https://github.com/AdoptOpenJDK/openjdk9-binaries/releases/download/jdk-9.0.4%2B11/OpenJDK9U-jdk_x64_linux_hotspot_9.0.4_11.tar.gz",
                    sha256 = "aa4fc8bda11741facaf3b8537258a4497c6e0046b9f4931e31f713d183b951f1"
            ),
            libPaths = setOf("lib"),
            lombok = lombok1_18_4,
            supportedWarnings = openjdk8.supportedWarnings + setOf(
                    "exports", "module", "opens", "removal", "requires-automatic", "requires-transitive-automatic")
    )
    private val openjdk10 = Sdk.OpenJdk(
            10,
            name = "OpenJDK 10",
            distribution = RemoteFile(
                    "https://github.com/AdoptOpenJDK/openjdk10-binaries/releases/download/jdk-10.0.2%2B13.1/OpenJDK10U-jdk_x64_linux_hotspot_10.0.2_13.tar.gz",
                    sha256 = "3998c36c7feb4bb7a565b3d33609ec67acd40f1ae5addf103378f2ef32ab377f"
            ),
            libPaths = setOf("lib"),
            lombok = lombok1_18_4,
            supportedWarnings = openjdk9.supportedWarnings
    )
    private val openjdk11 = Sdk.OpenJdk(
            11,
            name = "OpenJDK 11",
            distribution = RemoteFile(
                    "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.7%2B10/OpenJDK11U-jdk_x64_linux_hotspot_11.0.7_10.tar.gz",
                    sha256 = "ee60304d782c9d5654bf1a6b3f38c683921c1711045e1db94525a51b7024a2ca"
            ),
            libPaths = setOf("lib"),
            lombok = lombok1_18_4,
            supportedWarnings = openjdk10.supportedWarnings + "preview"
    )
    private val openjdk12 = Sdk.OpenJdk(
            12,
            name = "OpenJDK 12.0.2",
            distribution = RemoteFile(
                    "https://github.com/AdoptOpenJDK/openjdk12-binaries/releases/download/jdk-12.0.2%2B10/OpenJDK12U-jdk_x64_linux_hotspot_12.0.2_10.tar.gz",
                    sha256 = "1202f536984c28d68681d51207a84b6c76e5998579132d3fe1b8085aa6a5f21e"
            ),
            libPaths = setOf("lib"),
            lombok = lombok1_18_10,
            supportedWarnings = openjdk11.supportedWarnings + "text-blocks"
    )
    private val openjdk13 = Sdk.OpenJdk(
            13,
            name = "OpenJDK 13",
            distribution = RemoteFile(
                    "https://github.com/AdoptOpenJDK/openjdk13-binaries/releases/download/jdk-13.0.2%2B8/OpenJDK13U-jdk_x64_linux_hotspot_13.0.2_8.tar.gz",
                    sha256 = "9ccc063569f19899fd08e41466f8c4cd4e05058abdb5178fa374cb365dcf5998"
            ),
            libPaths = setOf("lib"),
            lombok = lombok1_18_10,
            supportedWarnings = openjdk12.supportedWarnings
    )
    private val openjdk14 = Sdk.OpenJdk(
            14,
            name = "OpenJDK 14",
            distribution = RemoteFile(
                    "https://github.com/AdoptOpenJDK/openjdk14-binaries/releases/download/jdk-14.0.1%2B7/OpenJDK14U-jdk_x64_linux_hotspot_14.0.1_7.tar.gz",
                    sha256 = "9ddf9b35996fbd784a53fff3e0d59920a7d5acf1a82d4c8d70906957ac146cd1"
            ),
            libPaths = setOf("lib"),
            lombok = lombok1_18_10,
            supportedWarnings = openjdk13.supportedWarnings
    )
    private val openjdk = listOf(
            openjdk14, openjdk13, openjdk12, openjdk11, openjdk10, openjdk9, openjdk8, openjdk7, openjdk6)
    val defaultJava = openjdk14

    private val ecj3_11 = Sdk.Ecj(
            release = 8,
            name = "Eclipse ECJ 3.11.1",
            aliases = setOf("Eclipse ECJ 4.5.1"), // mistakenly called it this at first
            compilerJar = RemoteFile("https://repo1.maven.org/maven2/org/eclipse/jdt/core/compiler/ecj/4.5.1/ecj-4.5.1.jar"),
            lombok = lombok1_18_4,
            hostJdk = openjdk8,
            supportedWarnings = setOf(<commit_msg>Add OpenJDK 15 and make it default JDK<commit_after>package at.yawk.javap

data class RemoteFile(
        val url: String,
        val md5: String? = null,
        val sha256: String? = null,
        val sha512: String? = null
)

sealed class Sdk(
        val language: SdkLanguage
) {
    abstract val name: String

    /**
     * Previous SDK names that should now be treated as this SDK
     */
    open val aliases: Set<String>
        get() = emptySet()

    interface HasLint {
        val supportedWarnings: Set<String>
    }

    interface Java : HasLint {
        val release: Int
    }

    data class OpenJdk(
            override val release: Int,

            override val name: String,
            val distribution: RemoteFile,
            val lombok: RemoteFile,
            val libPaths: Set<String>,
            override val supportedWarnings: Set<String>,

            override val aliases: Set<String> = emptySet()
    ) : Sdk(SdkLanguage.JAVA), Java

    data class Ecj(
            override val release: Int,

            override val name: String,
            val compilerJar: RemoteFile,
            val lombok: RemoteFile,
            val hostJdk: OpenJdk,
            override val supportedWarnings: Set<String>,

            override val aliases: Set<String> = emptySet()
    ) : Sdk(SdkLanguage.JAVA), Java

    interface Kotlin {
        val release: KotlinVersion
    }

    data class KotlinJar(
            override val release: KotlinVersion,
            override val name: String,
            val compilerJar: RemoteFile,
            val hostJdk: OpenJdk
    ) : Sdk(SdkLanguage.KOTLIN), Kotlin

    data class KotlinDistribution(
            override val release: KotlinVersion,
            override val name: String,
            val distribution: RemoteFile,
            val hostJdk: OpenJdk,
            val coroutines: RemoteFile
    ) : Sdk(SdkLanguage.KOTLIN), Kotlin

    data class Scala(
            val release: KotlinVersion,
            override val name: String,
            val sdk: RemoteFile,
            val hostJdk: OpenJdk,
            override val supportedWarnings: Set<String>
    ) : Sdk(SdkLanguage.SCALA), HasLint
}

object Sdks {
    private val lombok1_18_10 = RemoteFile("https://repo1.maven.org/maven2/org/projectlombok/lombok/1.18.10/lombok-1.18.10.jar")
    private val lombok1_18_4 = RemoteFile("https://repo1.maven.org/maven2/org/projectlombok/lombok/1.18.4/lombok-1.18.4.jar")

    private val openjdk6 = Sdk.OpenJdk(
            6,
            name = "OpenJDK 6u79",
            distribution = RemoteFile(
                    "http://cdn.azul.com/zulu/bin/zulu6.12.0.2-jdk6.0.79-linux_x64.tar.gz",
                    md5 = "a54fb082c89de3909df5b69cd50a2155"
            ),
            libPaths = setOf("lib/amd64", "lib/amd64/jli"),
            lombok = lombok1_18_4,
            supportedWarnings = setOf(
                    "cast", "deprecation", "divzero", "empty", "unchecked", "fallthrough", "path", "serial",
                    "finally", "overrides")
    )
    private val openjdk7 = Sdk.OpenJdk(
            7,
            name = "OpenJDK 7u101",
            distribution = RemoteFile(
                    "http://cdn.azul.com/zulu/bin/zulu7.14.0.5-jdk7.0.101-linux_x64.tar.gz",
                    md5 = "6fd6af8bc9a696116b7eeff8d28b0e98"
            ),
            libPaths = setOf("lib/amd64", "lib/amd64/jli"),
            lombok = lombok1_18_4,
            supportedWarnings = openjdk6.supportedWarnings + setOf(
                    "classfile", "dep-ann", "options", "processing", "rawtypes", "static", "try", "varargs")
    )
    private val openjdk8 = Sdk.OpenJdk(
            8,
            name = "OpenJDK 8",
            aliases = setOf("OpenJDK 8u92"),
            distribution = RemoteFile(
                    "https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u252-b09/OpenJDK8U-jdk_x64_linux_hotspot_8u252b09.tar.gz",
                    sha256 = "2b59b5282ff32bce7abba8ad6b9fde34c15a98f949ad8ae43e789bbd78fc8862"
            ),
            libPaths = setOf("lib/amd64", "lib/amd64/jli"),
            lombok = lombok1_18_4,
            supportedWarnings = openjdk7.supportedWarnings + setOf("auxiliaryclass", "overloads")
    )
    private val openjdk9 = Sdk.OpenJdk(
            9,
            name = "OpenJDK 9",
            aliases = setOf("OpenJDK 9.0.0"),
            distribution = RemoteFile(
                    "https://github.com/AdoptOpenJDK/openjdk9-binaries/releases/download/jdk-9.0.4%2B11/OpenJDK9U-jdk_x64_linux_hotspot_9.0.4_11.tar.gz",
                    sha256 = "aa4fc8bda11741facaf3b8537258a4497c6e0046b9f4931e31f713d183b951f1"
            ),
            libPaths = setOf("lib"),
            lombok = lombok1_18_4,
            supportedWarnings = openjdk8.supportedWarnings + setOf(
                    "exports", "module", "opens", "removal", "requires-automatic", "requires-transitive-automatic")
    )
    private val openjdk10 = Sdk.OpenJdk(
            10,
            name = "OpenJDK 10",
            distribution = RemoteFile(
                    "https://github.com/AdoptOpenJDK/openjdk10-binaries/releases/download/jdk-10.0.2%2B13.1/OpenJDK10U-jdk_x64_linux_hotspot_10.0.2_13.tar.gz",
                    sha256 = "3998c36c7feb4bb7a565b3d33609ec67acd40f1ae5addf103378f2ef32ab377f"
            ),
            libPaths = setOf("lib"),
            lombok = lombok1_18_4,
            supportedWarnings = openjdk9.supportedWarnings
    )
    private val openjdk11 = Sdk.OpenJdk(
            11,
            name = "OpenJDK 11",
            distribution = RemoteFile(
                    "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.7%2B10/OpenJDK11U-jdk_x64_linux_hotspot_11.0.7_10.tar.gz",
                    sha256 = "ee60304d782c9d5654bf1a6b3f38c683921c1711045e1db94525a51b7024a2ca"
            ),
            libPaths = setOf("lib"),
            lombok = lombok1_18_4,
            supportedWarnings = openjdk10.supportedWarnings + "preview"
    )
    private val openjdk12 = Sdk.OpenJdk(
            12,
            name = "OpenJDK 12.0.2",
            distribution = RemoteFile(
                    "https://github.com/AdoptOpenJDK/openjdk12-binaries/releases/download/jdk-12.0.2%2B10/OpenJDK12U-jdk_x64_linux_hotspot_12.0.2_10.tar.gz",
                    sha256 = "1202f536984c28d68681d51207a84b6c76e5998579132d3fe1b8085aa6a5f21e"
            ),
            libPaths = setOf("lib"),
            lombok = lombok1_18_10,
            supportedWarnings = openjdk11.supportedWarnings + "text-blocks"
    )
    private val openjdk13 = Sdk.OpenJdk(
            13,
            name = "OpenJDK 13",
            distribution = RemoteFile(
                    "https://github.com/AdoptOpenJDK/openjdk13-binaries/releases/download/jdk-13.0.2%2B8/OpenJDK13U-jdk_x64_linux_hotspot_13.0.2_8.tar.gz",
                    sha256 = "9ccc063569f19899fd08e41466f8c4cd4e05058abdb5178fa374cb365dcf5998"
            ),
            libPaths = setOf("lib"),
            lombok = lombok1_18_10,
            supportedWarnings = openjdk12.supportedWarnings
    )
    private val openjdk14 = Sdk.OpenJdk(
            14,
            name = "OpenJDK 14",
            distribution = RemoteFile(
                    "https://github.com/AdoptOpenJDK/openjdk14-binaries/releases/download/jdk-14.0.1%2B7/OpenJDK14U-jdk_x64_linux_hotspot_14.0.1_7.tar.gz",
                    sha256 = "9ddf9b35996fbd784a53fff3e0d59920a7d5acf1a82d4c8d70906957ac146cd1"
            ),
            libPaths = setOf("lib"),
            lombok = lombok1_18_10,
            supportedWarnings = openjdk13.supportedWarnings
    )
    private val openjdk15 = Sdk.OpenJdk(
            15,
            name = "OpenJDK 15",
            distribution = RemoteFile(
                    "https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36/OpenJDK15U-jdk_x64_linux_hotspot_15_36.tar.gz",
                    sha256 = "c198593d1b5188ee3570e2ca33c3bc004aaefbda2c11e68e58ae7296cf5c3982"
            ),
            libPaths = setOf("lib"),
            lombok = lombok1_18_10,
            supportedWarnings = openjdk14.supportedWarnings
    )
    private val openjdk = listOf(
            openjdk15, openjdk14, openjdk13, openjdk12, openjdk11, openjdk10, openjdk9, openjdk8, openjdk7, openjdk6)
    val defaultJava = openjdk15

    private val ecj3_11 = Sdk.Ecj(
            release = 8,
            name = "Eclipse ECJ 3.11.1",
            aliases = setOf("Eclipse ECJ 4.5.1"), // mistakenly called it this at first
            compilerJar = RemoteFile("https://repo1.maven.org/maven2/org/eclipse/jdt/core/compiler/ecj/4.5.1/ecj-4.5.1.jar"),
            lombok = lombok1_18_4,
            hostJdk = openjdk8,
            supportedWarnings = setOf(
{'fraction_non_alphanumeric': 0.09979429914781075, 'fraction_numerical': 0.08457243608580664, 'mean_word_length': 1.982646801051709, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 21, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 15, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2357535', 'n_tokens_mistral': 6574, 'n_tokens_neox': 5814, 'n_words': 930}