<commit_before>package com.github.alexfu

import groovy.json.JsonOutput
import groovy.json.internal.LazyMap

import static com.github.alexfu.AndroidAutoVersionPlugin.VersionType.MAJOR
import static com.github.alexfu.AndroidAutoVersionPlugin.VersionType.MINOR
import static com.github.alexfu.AndroidAutoVersionPlugin.VersionType.PATCH

class Version {
    int buildNumber = 0;
    int patch = 0;
    int minor = 0;
    int major = 0;
    int revision = 0;
    Closure<String> formatter;

    Version(Version source) {
        buildNumber = source.buildNumber;
        patch = source.patch;
        minor = source.minor;
        major = source.major;
        revision = source.revision;
        formatter = source.formatter;
    }

    Version(LazyMap source, Closure<String> formatter) {
        buildNumber = source.buildNumber;
        patch = source.patch;
        minor = source.minor;
        major = source.major;
        if (source.revision) {
            revision = source.revision;
        }
        this.formatter = formatter;
    }

    String versionName() {
        if (formatter == null) {
            return applyRevision("${major}.${minor}.${patch}")
        }
        return applyRevision(formatter.call(major, minor, patch, buildNumber))
    }

    String betaVersionName() {
        return applyRevision("$versionName()-beta")
    }

    int versionCode() {<commit_msg>Wrap function call in curly braces<commit_after>package com.github.alexfu

import groovy.json.JsonOutput
import groovy.json.internal.LazyMap

import static com.github.alexfu.AndroidAutoVersionPlugin.VersionType.MAJOR
import static com.github.alexfu.AndroidAutoVersionPlugin.VersionType.MINOR
import static com.github.alexfu.AndroidAutoVersionPlugin.VersionType.PATCH

class Version {
    int buildNumber = 0;
    int patch = 0;
    int minor = 0;
    int major = 0;
    int revision = 0;
    Closure<String> formatter;

    Version(Version source) {
        buildNumber = source.buildNumber;
        patch = source.patch;
        minor = source.minor;
        major = source.major;
        revision = source.revision;
        formatter = source.formatter;
    }

    Version(LazyMap source, Closure<String> formatter) {
        buildNumber = source.buildNumber;
        patch = source.patch;
        minor = source.minor;
        major = source.major;
        if (source.revision) {
            revision = source.revision;
        }
        this.formatter = formatter;
    }

    String versionName() {
        if (formatter == null) {
            return applyRevision("${major}.${minor}.${patch}")
        }
        return applyRevision(formatter.call(major, minor, patch, buildNumber))
    }

    String betaVersionName() {
        return applyRevision("${versionName()}-beta")
    }

    int versionCode() {
{'fraction_non_alphanumeric': 0.10010725777618877, 'fraction_numerical': 0.003575259206292456, 'mean_word_length': 2.633766233766234, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '247521', 'n_tokens_mistral': 836, 'n_tokens_neox': 782, 'n_words': 173}