<commit_before>package com.uber.okbuck.core.model

import com.uber.okbuck.OkBuckGradlePlugin
import com.uber.okbuck.core.util.ProjectUtil
import org.gradle.api.Project

/**
 * A java library target
 */
class JavaLibTarget extends JavaTarget {

    static final String MAIN = "main"
    final Scope retrolambda
    final Scope postProcess

    protected final List<String> extraJvmArgs = []

    JavaLibTarget(Project project, String name) {
        super(project, name)

        // Retrolambda
        if (project.plugins.hasPlugin('me.tatarka.retrolambda')) {
            retrolambda = new Scope(project, ["retrolambdaConfig"] as Set)
            extraJvmArgs.addAll(["-bootclasspath", bootClasspath])
        } else {
            retrolambda = null
        }

        postProcess = new Scope(project.getRootProject(), [OkBuckGradlePlugin.CONFIGURATION_POST_PROCESS] as Set)
    }

    @Override
    Scope getMain() {
        return new Scope(project,
                ["compile"],
                project.files("src/main/java") as Set,
                project.file("src/main/resources"),
                project.compileJava.options.compilerArgs + extraJvmArgs as List<String>)
    }

    @Override
    Scope getTest() {
        return new Scope(project,
                ["testCompile"],
                project.files("src/test/java") as Set,
                project.file("src/test/resources"),
                project.compileTestJava.options.compilerArgs + extraJvmArgs as List<String>)
    }

    String getSourceCompatibility() {
        return javaVersion(project.sourceCompatibility)
    }

    String getTargetCompatibility() {
        return javaVersion(project.sourceCompatibility)
    }

    String getRetroLambdaJar() {
        retrolambda.externalDeps[0]
    }

    String getBootClasspath() {
        String bootCp = initialBootCp
        if (retrolambda) {
            bootCp += ":${ProjectUtil.runtimeJar}"
        }
        return bootCp
    }

    List<String> getPostProcessClassesCommands() {
        return (List<String>) getProp(okbuck.postProcessClassesCommands, [])
    }

    protected String getInitialBootCp() {<commit_msg>Fix for when initial boot class path is empty or null<commit_after>package com.uber.okbuck.core.model

import com.uber.okbuck.OkBuckGradlePlugin
import com.uber.okbuck.core.util.ProjectUtil
import org.gradle.api.Project

/**
 * A java library target
 */
class JavaLibTarget extends JavaTarget {

    static final String MAIN = "main"
    final Scope retrolambda
    final Scope postProcess

    protected final List<String> extraJvmArgs = []

    JavaLibTarget(Project project, String name) {
        super(project, name)

        // Retrolambda
        if (project.plugins.hasPlugin('me.tatarka.retrolambda')) {
            retrolambda = new Scope(project, ["retrolambdaConfig"] as Set)
            extraJvmArgs.addAll(["-bootclasspath", bootClasspath])
        } else {
            retrolambda = null
        }

        postProcess = new Scope(project.getRootProject(), [OkBuckGradlePlugin.CONFIGURATION_POST_PROCESS] as Set)
    }

    @Override
    Scope getMain() {
        return new Scope(project,
                ["compile"],
                project.files("src/main/java") as Set,
                project.file("src/main/resources"),
                project.compileJava.options.compilerArgs + extraJvmArgs as List<String>)
    }

    @Override
    Scope getTest() {
        return new Scope(project,
                ["testCompile"],
                project.files("src/test/java") as Set,
                project.file("src/test/resources"),
                project.compileTestJava.options.compilerArgs + extraJvmArgs as List<String>)
    }

    String getSourceCompatibility() {
        return javaVersion(project.sourceCompatibility)
    }

    String getTargetCompatibility() {
        return javaVersion(project.sourceCompatibility)
    }

    String getRetroLambdaJar() {
        retrolambda.externalDeps[0]
    }

    String getBootClasspath() {
        List<String> classpaths = []
        if (initialBootCp) {
            classpaths.add(initialBootCp)
        }
        if (retrolambda) {
            classpaths.add(ProjectUtil.runtimeJar)
        }
        return classpaths.join(":")
    }

    List<String> getPostProcessClassesCommands() {
        return (List<String>) getProp(okbuck.postProcessClassesCommands, [])
    }

    protected String getInitialBootCp() {
{'fraction_non_alphanumeric': 0.09887133182844243, 'fraction_numerical': 0.0004514672686230248, 'mean_word_length': 2.459016393442623, 'pattern_counts': {'":': 2, '<': 14, '<?xml version=': 0, '>': 14, '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': '534839', 'n_tokens_mistral': 1284, 'n_tokens_neox': 1223, 'n_words': 245}