/*
 * Copyright 2018 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package androidx.room.solver.prepared.binderprovider

import androidx.room.parser.ParsedQuery
import androidx.room.processor.Context
import androidx.room.solver.prepared.binder.InstantPreparedQueryResultBinder
import javax.lang.model.type.DeclaredType

class InstantPreparedQueryResultBinderProvider(
    val context: Context
) : PreparedQueryResultBinderProvider {

    override fun matches(declared: DeclaredType) = true

    override fun provide(
        declared: DeclaredType,
        query: ParsedQuery
    ) = InstantPreparedQueryResultBinder(
        context.typeAdapterStore.findPreparedQueryResultAdapter(declared.enclosingType, query)
    )
}

Remove unnecessary superclass usage in Instant result binder provider

/*
 * Copyright 2018 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package androidx.room.solver.prepared.binderprovider

import androidx.room.parser.ParsedQuery
import androidx.room.processor.Context
import androidx.room.solver.prepared.binder.InstantPreparedQueryResultBinder
import javax.lang.model.type.DeclaredType

class InstantPreparedQueryResultBinderProvider(
    val context: Context
) : PreparedQueryResultBinderProvider {

    override fun matches(declared: DeclaredType) = true

    override fun provide(
        declared: DeclaredType,
        query: ParsedQuery
    ) = InstantPreparedQueryResultBinder(
        context.typeAdapterStore.findPreparedQueryResultAdapter(declared, query)
    )
}


/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

object AndroidComponents {
    const val VERSION = "91.0.20210624190127"
}

Update Android Components to 91.0.20210705190256.

/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

object AndroidComponents {
    const val VERSION = "91.0.20210705190256"
}


/*
 * Copyright 2020, TeamDev. All rights reserved.
 *
 * Redistribution and use in source and/or binary forms, with or without
 * modification, must retain the above copyright notice and the following
 * disclaimer.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

rootProject.name = "spine.io"

includeBuild("./_code/samples")

includeBuild("./_code/examples/hello")

Add all example repos as included build

/*
 * Copyright 2020, TeamDev. All rights reserved.
 *
 * Redistribution and use in source and/or binary forms, with or without
 * modification, must retain the above copyright notice and the following
 * disclaimer.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

rootProject.name = "spine.io"

includeBuild("./_code/samples")

includeBuild("./_code/examples/airport")
includeBuild("./_code/examples/blog")
includeBuild("./_code/examples/hello")
includeBuild("./_code/examples/kanban")
includeBuild("./_code/examples/todo-list")


/*
 * Copyright 2018 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
import org.gradle.gradlebuild.unittestandcompile.ModuleType

plugins {
    `java-library`
     gradlebuild.classycle
}

description = "Tools to take immutable, comparable snapshots of files and other things"

dependencies {
    implementation(project(":baseServices"))
    implementation(project(":native"))
    implementation(project(":messaging"))
    implementation(project(":coreApi"))
    implementation(project(":persistentCache"))

    implementation(library("guava"))
    implementation(library("jsr305"))
    implementation(library("inject"))

    testImplementation(project(":processServices"))
    testImplementation(project(":resources"))
    testImplementation(library("ant"))
}

gradlebuildJava {
    moduleType = ModuleType.CORE
}

testFixtures {
    from(":baseServices")
    from(":files")
    from(":messaging")
    from(":core")
    from(":coreApi")
}

Remove unnecessary dependencies from :snapshots

/*
 * Copyright 2018 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
import org.gradle.gradlebuild.unittestandcompile.ModuleType

plugins {
    `java-library`
     gradlebuild.classycle
}

description = "Tools to take immutable, comparable snapshots of files and other things"

dependencies {
    implementation(library("guava"))
    implementation(library("jsr305"))
    implementation(project(":pineapple"))

    testImplementation(project(":processServices"))
    testImplementation(project(":resources"))
    testImplementation(project(":native"))
    testImplementation(library("ant"))
}

gradlebuildJava {
    moduleType = ModuleType.CORE
}

testFixtures {
    from(":baseServices")
    from(":files")
    from(":messaging")
    from(":core")
    from(":coreApi")
}


buildscript {

    repositories {
        gradleScriptKotlin()
    }

    dependencies {
        classpath(kotlinModule("gradle-plugin", version = "1.0.3"))
    }
}

apply {
    plugin("kotlin")
    plugin<ApplicationPlugin>()
}

configure<ApplicationPluginConvention> {
    mainClassName = "samples.HelloWorldKt"
}

repositories {
    gradleScriptKotlin()
}

dependencies {
    compile(kotlinModule("stdlib", version = "1.0.3"))
}

Revert accidental `hello-kotlin` sample changes

buildscript {

    repositories {
        gradleScriptKotlin()
    }

    dependencies {
        classpath(kotlinModule("gradle-plugin"))
    }
}

apply {
    plugin("kotlin")
    plugin<ApplicationPlugin>()
}

configure<ApplicationPluginConvention> {
    mainClassName = "samples.HelloWorldKt"
}

repositories {
    gradleScriptKotlin()
}

dependencies {
    compile(kotlinModule("stdlib"))
}


package com.reduks.reduks

import com.reduks.reduks.subscription.Subscriber
import com.reduks.reduks.subscription.Subscription

class Store<State>(initialState: State, initialReducer: (state: State, action: Action<State>) -> State, enhancer: Enhancer<State>? = null) {

    private val subscribers: MutableList<Subscriber<State>> = mutableListOf()
    private var isCurrentDispatching = false
    private val reducer: (state: State, action: Action<State>) -> State = enhancer?.enhance(enhanceReducerWithDispatch(initialReducer), this) ?: enhanceReducerWithDispatch(initialReducer)
    private var state: State = initialState

    fun subscribe(subscriber: Subscriber<State>): Subscription {
        subscribers.add(subscriber)
        return Subscription { subscribers.remove(subscriber) }
    }

    fun dispatch(action: Action<State>) {
        reducer(state, action)
    }

    private fun enhanceReducerWithDispatch(reducer: (state: State, action: Action<State>) -> State): (state: State, action: Action<State>) -> State = { state, action ->
        startDispatching()
        val newState = reducer(state, action)
        stopDispatching()
        notifySubscribers()
        newState
    }

    private fun notifySubscribers() {
        subscribers.forEach { it.stateChanged(state) }
    }

    private fun startDispatching() {
        if (isCurrentDispatching) throw IllegalStateException("You can't dispatch inside a dispatch")
        isCurrentDispatching = true
    }

    private fun stopDispatching() {
        isCurrentDispatching = false
    }
}

Fix store state notifier bug

package com.reduks.reduks

import com.reduks.reduks.subscription.Subscriber
import com.reduks.reduks.subscription.Subscription

class Store<State>(initialState: State, initialReducer: (state: State, action: Action<State>) -> State, enhancer: Enhancer<State>? = null) {

    private val subscribers: MutableList<Subscriber<State>> = mutableListOf()
    private var isCurrentDispatching = false
    private val reducer: (state: State, action: Action<State>) -> State = enhancer?.enhance(enhanceReducerWithDispatch(initialReducer), this) ?: enhanceReducerWithDispatch(initialReducer)
    private var state: State = initialState

    fun subscribe(subscriber: Subscriber<State>): Subscription {
        subscribers.add(subscriber)
        return Subscription { subscribers.remove(subscriber) }
    }

    fun dispatch(action: Action<State>) {
        reducer(state, action)
    }

    fun getState() : State = state

    private fun enhanceReducerWithDispatch(reducer: (state: State, action: Action<State>) -> State): (state: State, action: Action<State>) -> State = { state, action ->
        startDispatching()
        val newState = reducer(state, action)
        stopDispatching()
        notifySubscribers(newState)
        newState
    }

    private fun notifySubscribers(state: State) {
        subscribers.forEach { it.stateChanged(state) }
    }

    private fun startDispatching() {
        if (isCurrentDispatching) throw IllegalStateException("You can't dispatch inside a dispatch")
        isCurrentDispatching = true
    }

    private fun stopDispatching() {
        isCurrentDispatching = false
    }
}


import com.github.kamatama41.gradle.gitrelease.GitReleaseExtension

buildscript {
    repositories {
        jcenter()
        maven { setUrl("http://kamatama41.github.com/maven-repository/repository") }
    }
    dependencies {
        classpath("com.github.kamatama41:gradle-git-release-plugin:0.2.0")
    }
}

plugins {
    idea
    kotlin("jvm") version "1.2.31"
}

apply {
    plugin("com.github.kamatama41.git-release")
}

repositories {
    jcenter()
}

configure<JavaPluginConvention> {
    sourceCompatibility = JavaVersion.VERSION_1_8
    targetCompatibility = JavaVersion.VERSION_1_8
}

dependencies {
    compile(kotlin("stdlib"))
    compile("org.embulk:embulk-standards:0.9.7")
    compile("org.embulk:embulk-test:0.9.7")
    testCompile("junit:junit:4.12")
}

configure<GitReleaseExtension> {
    groupId = "com.github.kamatama41"
    artifactId = "embulk-test-helpers"
    repoUri = "git@github.com:kamatama41/maven-repository.git"
    repoDir = file("${System.getProperty("user.home")}/gh-maven-repository")
}

Add a limitation of memory usage for test task.

import com.github.kamatama41.gradle.gitrelease.GitReleaseExtension

buildscript {
    repositories {
        jcenter()
        maven { setUrl("http://kamatama41.github.com/maven-repository/repository") }
    }
    dependencies {
        classpath("com.github.kamatama41:gradle-git-release-plugin:0.2.0")
    }
}

plugins {
    idea
    kotlin("jvm") version "1.2.31"
}

apply {
    plugin("com.github.kamatama41.git-release")
}

repositories {
    jcenter()
}

configure<JavaPluginConvention> {
    sourceCompatibility = JavaVersion.VERSION_1_8
    targetCompatibility = JavaVersion.VERSION_1_8
}

dependencies {
    compile(kotlin("stdlib"))
    compile("org.embulk:embulk-standards:0.9.7")
    compile("org.embulk:embulk-test:0.9.7")
    testCompile("junit:junit:4.12")
}

configure<GitReleaseExtension> {
    groupId = "com.github.kamatama41"
    artifactId = "embulk-test-helpers"
    repoUri = "git@github.com:kamatama41/maven-repository.git"
    repoDir = file("${System.getProperty("user.home")}/gh-maven-repository")
}

tasks {
    named<Test>("test") {
        // Not to exceed the limit of CircleCI (4GB)
        maxHeapSize = "3g"
    }
}


package venus.assembler

object Lexer {
    private fun stripComment(line: String) = line.replaceAfter('#', "").replace("#", "")
    private fun cleanForLabel(line: String) = stripComment(line).trim()
    private fun getLabel(line: String) = cleanForLabel(line).substringBefore(':', "")
    private fun stripLabel(line: String) = line.replaceBefore(':', "").replace(":", "")
    private fun cleanLine(line: String): String {
        var cleanedLine = line
        cleanedLine = stripComment(cleanedLine)
        cleanedLine = stripLabel(cleanedLine)
                        .replace(',', ' ')
                        .replace('(', ' ')
                        .replace(')', ' ')
                        .trim()
                        .replace(Regex("\\s+"), " ")
        return cleanedLine
    }

    /* TODO: better lexer (ANTLR?) */

    /** Lex a line into a label (if there) and a list of arguments */
    fun lexLine(line: String) = Pair(getLabel(line), cleanLine(line).split(' '))

    private val asciizPattern = "\\s*\\.asciiz\\s+\"((?:[^\"\\\\]|\\\\.)*)\"\\s*".toRegex()
    fun lexAsciizDirective(line: String): String? =
        asciizPattern.matchEntire(line)?.groups?.get(1)?.value
}

Allow label and asciiz directive on same line

package venus.assembler

object Lexer {
    private fun stripComment(line: String) = line.replaceAfter('#', "").replace("#", "")
    private fun cleanForLabel(line: String) = stripComment(line).trim()
    private fun getLabel(line: String) = cleanForLabel(line).substringBefore(':', "")
    private fun stripLabel(line: String) = line.replaceBefore(':', "").replace(":", "")
    private fun cleanLine(line: String): String {
        var cleanedLine = line
        cleanedLine = stripComment(cleanedLine)
        cleanedLine = stripLabel(cleanedLine)
                        .replace(',', ' ')
                        .replace('(', ' ')
                        .replace(')', ' ')
                        .trim()
                        .replace(Regex("\\s+"), " ")
        return cleanedLine
    }

    /* TODO: better lexer (ANTLR?) */

    /** Lex a line into a label (if there) and a list of arguments */
    fun lexLine(line: String) = Pair(getLabel(line), cleanLine(line).split(' '))

    private val asciizPattern = "\\s*\\.asciiz\\s+\"((?:[^\"\\\\]|\\\\.)*)\"\\s*".toRegex()
    fun lexAsciizDirective(line: String): String? =
        asciizPattern.matchEntire(stripLabel(line))?.groups?.get(1)?.value
}


package uk.co.craigbass.pratura.domain

import org.joda.money.*
import org.joda.money.format.MoneyFormatterBuilder
import java.math.BigDecimal
import java.util.*

class Currency(val currency: String, val country: String, val language: String) {
  fun format(amount: BigDecimal): String {
    val currencyUnit = CurrencyUnit.of(currency)
    val formatter = MoneyFormatterBuilder()
      .appendCurrencySymbolLocalized()
      .appendAmountLocalized()
      .toFormatter(Locale(language, country))
    return formatter.print(Money.of(currencyUnit, amount))
  }
}

Create locale at construct time

package uk.co.craigbass.pratura.domain

import org.joda.money.*
import org.joda.money.format.MoneyFormatterBuilder
import java.math.BigDecimal
import java.util.*

class Currency(val currency: String, val locale: Locale) {
  constructor(currency: String, country: String, language: String)
    : this(currency, Locale(language, country))

  val country: String get() = locale.country
  val language: String get() = locale.language

  private val moneyFormatter
    get() = MoneyFormatterBuilder()
      .appendCurrencySymbolLocalized()
      .appendAmountLocalized()
      .toFormatter(locale)

  fun format(amount: BigDecimal): String {
    return formatMoney(amount.toMoney())
  }

  private fun formatMoney(money: Money): String {
    return moneyFormatter.print(money)
  }

  private fun BigDecimal.toMoney() = Money.of(CurrencyUnit.of(currency), this)
}


package com.emberjs

enum class EmberFileType(val fileExtension: String = "js") {
    ADAPTER(),
    COMPONENT(),
    CONTROLLER(),
    HELPER(),
    INITIALIZER(),
    MIXIN(),
    MODEL(),
    ROUTE(),
    SERIALIZER(),
    SERVICE(),
    TEMPLATE("hbs"),
    TRANSFORM(),
    VIEW();

    val fileName = "${name.toLowerCase()}.$fileExtension"
    val folderName = "${name.toLowerCase()}s"

    companion object {
        val FILE_NAMES = values.toMap({ it.fileName }, { it })
        val FOLDER_NAMES = values.toMap({ it.folderName }, { it })
    }
}

Use values() instead of values property

package com.emberjs

enum class EmberFileType(val fileExtension: String = "js") {
    ADAPTER(),
    COMPONENT(),
    CONTROLLER(),
    HELPER(),
    INITIALIZER(),
    MIXIN(),
    MODEL(),
    ROUTE(),
    SERIALIZER(),
    SERVICE(),
    TEMPLATE("hbs"),
    TRANSFORM(),
    VIEW();

    val fileName = "${name.toLowerCase()}.$fileExtension"
    val folderName = "${name.toLowerCase()}s"

    companion object {
        val FILE_NAMES = values().toMap({ it.fileName }, { it })
        val FOLDER_NAMES = values().toMap({ it.folderName }, { it })
    }
}


package com.gitlab.artismarti.tinbo.start

/**
 * @author artur
 */
object ModeAdvicer {

    private var mode = Mode.START

    fun setTimerMode() {
        mode = Mode.TIMER
    }

    fun isTimerMode(): Boolean {
        return mode == Mode.TIMER
    }

    fun setStartMode() {
        mode = Mode.START
    }

    fun isStartMode(): Boolean {
        return mode == Mode.START
    }
}


plugins {
  id("org.metaborg.gradle.config.root-project") version "0.3.21"
  id("org.metaborg.gitonium") version "0.1.2"

  // Set versions for plugins to use, only applying them in subprojects (apply false here).
  id("org.metaborg.spoofax.gradle.langspec") version "0.3.4" apply false
  id("de.set.ecj") version "1.4.1" apply false
}

subprojects {
  metaborg {
    configureSubProject()
  }
}

allprojects {
  version = "2.6.0-SNAPSHOT" // Override version from Git, as Spoofax Core uses a different versioning scheme.
}

Update to Spoofax Gradle 0.3.5.

plugins {
  id("org.metaborg.gradle.config.root-project") version "0.3.21"
  id("org.metaborg.gitonium") version "0.1.2"

  // Set versions for plugins to use, only applying them in subprojects (apply false here).
  id("org.metaborg.spoofax.gradle.langspec") version "0.3.5" apply false
  id("de.set.ecj") version "1.4.1" apply false
}

subprojects {
  metaborg {
    configureSubProject()
  }
}

allprojects {
  version = "2.6.0-SNAPSHOT" // Override version from Git, as Spoofax Core uses a different versioning scheme.
}


package iii_conventions

import util.TODO
import iii_conventions.TimeInterval.*

fun todoTask29(): Nothing = TODO(
    """
        Task 29.
        Implement a kind of date arithmetic. Support adding years, weeks and days to a date.
        Use classes 'MyDate' and 'TimeInterval'.
        Use a utility function 'MyDate.addTimeIntervals'.
        Uncomment the commented line and make it compile.

        (1). Add an extension function 'plus()' to MyDate, taking a TimeInterval as an argument.
        (2). Support adding several time intervals to a date. Add an extra class.
        If you have any problems, see the iii_conventions/_29_Tips.kt file.
    """,
    references = { date: MyDate, timeInterval: TimeInterval ->
        date.addTimeIntervals(timeInterval, 1)
    })

fun task29_1(today: MyDate): MyDate {
    todoTask29()
//    return today + YEAR + WEEK
}

fun task29_2(today: MyDate): MyDate {
    todoTask29()
//    return today + YEAR * 2 + WEEK * 3 + DAY * 5
}

Clarify instructions for exercise 29 (operators overloading)

package iii_conventions

import util.TODO
import iii_conventions.TimeInterval.*

fun todoTask29(): Nothing = TODO(
    """
        Task 29.
        Implement a kind of date arithmetic. Support adding years, weeks and days to a date.
        Use classes 'MyDate' and 'TimeInterval'.
        Use the provided utility function 'MyDate.addTimeIntervals'.
        Uncomment the commented line and make it compile.

        (1). Add an extension function 'plus()' to MyDate, taking a TimeInterval as an argument.
        (2). Support adding several time intervals to a date. Add an extra class.
        If you have any problems, see the iii_conventions/_29_Tips.kt file.
    """,
    references = { date: MyDate, timeInterval: TimeInterval ->
        date.addTimeIntervals(timeInterval, 1)
    })

fun task29_1(today: MyDate): MyDate {
    todoTask29()
//    return today + YEAR + WEEK
}

fun task29_2(today: MyDate): MyDate {
    todoTask29()
//    return today + YEAR * 2 + WEEK * 3 + DAY * 5
}


package org.purescript.parser

import com.intellij.psi.tree.IElementType
import java.util.*

abstract class Parsec {
    var name: String? = null
        get() {
            if (field == null) {
                field = calcName()
            }
            return field
        }
        private set
    var expectedName: HashSet<String?>? = null
        get() {
            if (field == null) {
                field = calcExpectedName()
            }
            return field
        }
        private set
    private var canBeEmpty: Boolean? = null
    abstract fun parse(context: ParserContext): ParserInfo
    protected abstract fun calcName(): String
    protected abstract fun calcExpectedName(): HashSet<String?>
    fun then(next: Parsec): Parsec {
        return Combinators.seq(this, next)
    }

    fun lexeme(type: IElementType): Parsec {
        return then(Combinators.lexeme(Combinators.token(type)))
    }

    fun or(next: Parsec): Parsec {
        return Combinators.choice(this, next)
    }

    fun `as`(node: IElementType): SymbolicParsec {
        return SymbolicParsec(this, node)
    }

    abstract fun canStartWith(type: IElementType): Boolean
    fun canBeEmpty(): Boolean {
        if (canBeEmpty == null) {
            canBeEmpty = calcCanBeEmpty()
        }
        return canBeEmpty!!
    }

    protected abstract fun calcCanBeEmpty(): Boolean
}

Implement seq as plus and use that in then

package org.purescript.parser

import com.intellij.psi.tree.IElementType
import java.util.*

abstract class Parsec {
    var name: String? = null
        get() {
            if (field == null) {
                field = calcName()
            }
            return field
        }
        private set
    var expectedName: HashSet<String?>? = null
        get() {
            if (field == null) {
                field = calcExpectedName()
            }
            return field
        }
        private set
    private var canBeEmpty: Boolean? = null
    abstract fun parse(context: ParserContext): ParserInfo
    protected abstract fun calcName(): String
    protected abstract fun calcExpectedName(): HashSet<String?>
    operator fun plus(other: Parsec): Parsec {
        return Combinators.seq(this, other)
    }
    fun then(next: Parsec): Parsec {
        return this + next
    }

    fun lexeme(type: IElementType): Parsec {
        return then(Combinators.lexeme(Combinators.token(type)))
    }

    fun or(next: Parsec): Parsec {
        return Combinators.choice(this, next)
    }

    fun `as`(node: IElementType): SymbolicParsec {
        return SymbolicParsec(this, node)
    }

    abstract fun canStartWith(type: IElementType): Boolean
    fun canBeEmpty(): Boolean {
        if (canBeEmpty == null) {
            canBeEmpty = calcCanBeEmpty()
        }
        return canBeEmpty!!
    }

    protected abstract fun calcCanBeEmpty(): Boolean
}


/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

object AndroidComponents {
    const val VERSION = "93.0.20210812143121"
}

Update Android Components version to 93.0.20210813143343

/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

object AndroidComponents {
    const val VERSION = "93.0.20210813143343"
}


Cover ID type of message direct (non) conversion

/*
 * Copyright 2021, TeamDev. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Redistribution and use in source and/or binary forms, with or without
 * modification, must retain the above copyright notice and the following
 * disclaimer.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

package io.spine.base;

import com.google.common.truth.Truth.assertThat
import io.spine.base.IdType.MESSAGE
import io.spine.base.IdType.STRING
import org.junit.jupiter.api.Test

class `'IdType' should` {

    @Test
    fun `pass 'Message' instance in conversion as is`() {
        val wrapped = STRING.toMessage(Identifier.newUuid())

        assertThat(MESSAGE.toMessage(wrapped))
            .isSameInstanceAs(wrapped)
        assertThat(MESSAGE.fromMessage(wrapped))
            .isSameInstanceAs(wrapped)
    }
}


package html4k.tests

import html4k.*
import html4k.dom.*
import html4k.dom.createHTMLDocument
import kotlin.test.assertEquals
import org.junit.Test as test

class TestDOMTrees {
    test fun `able to create simple tree`() {
        val tree = createHTMLDocument().div {
            id = "test-node"
            +"content"
        }

        assertEquals("div", tree.getElementById("test-node")?.getTagName()?.toLowerCase())
    }

    test fun `able to create complex tree and render it with pretty print`() {
        val tree = createHTMLDocument().html {
            body {
                h1 {
                    +"header"
                }
                div {
                    +"content"
                    span {
                        +"yo"
                    }
                }
            }
        }

        assertEquals("<!DOCTYPE html>\n
header

contentyo
", tree.serialize(false))
        assertEquals("<!DOCTYPE html>\n" +
                "\n" +
                "  \n" +
                "
header
\n" +
                "
contentyo\n" +
                "
\n" +
                "  \n" +
                "", tree.serialize(true).trim())
    }
}

Fix line endings in test to run successfully on windows

package html4k.tests

import html4k.*
import html4k.dom.*
import html4k.dom.createHTMLDocument
import kotlin.test.assertEquals
import org.junit.Test as test

class TestDOMTrees {
    test fun `able to create simple tree`() {
        val tree = createHTMLDocument().div {
            id = "test-node"
            +"content"
        }

        assertEquals("div", tree.getElementById("test-node")?.getTagName()?.toLowerCase())
    }

    test fun `able to create complex tree and render it with pretty print`() {
        val tree = createHTMLDocument().html {
            body {
                h1 {
                    +"header"
                }
                div {
                    +"content"
                    span {
                        +"yo"
                    }
                }
            }
        }

        assertEquals("<!DOCTYPE html>\n
header

contentyo
", tree.serialize(false))
        assertEquals("<!DOCTYPE html>\n" +
                "\n" +
                "  \n" +
                "
header
\n" +
                "
contentyo\n" +
                "
\n" +
                "  \n" +
                "", tree.serialize(true).trim().replace("\r\n", "\n"))
    }
}


package org.paradise.ipaq.services.redis

import org.slf4j.LoggerFactory
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.data.redis.RedisSystemException
import org.springframework.data.redis.core.StringRedisTemplate
import org.springframework.stereotype.Component

/**
 * Created by terrence on 25/5/17.
 */
@Component
class RedisClient {

    @Autowired
    private val stringRedisTemplate: StringRedisTemplate? = null

    fun persist(key: String, value: String): String {

        val valueOperations = stringRedisTemplate!!.opsForValue()

        valueOperations.set(key, value)

        val persistedValue = valueOperations.get(key)

        if (value != persistedValue) {
            throw RedisSystemException("Redis Server persistence error", null)
        }

        LOG.info("Key [{}] and Value [{}] has been successfully persisted into Redis server", key, persistedValue)

        return persistedValue
    }

    fun get(key: String): String {

        val valueOperations = stringRedisTemplate!!.opsForValue()

        val persistedValue = valueOperations.get(key)

        LOG.info("Value [{}] has been gotten from Redis server with key [{}]", persistedValue, key)

        return persistedValue
    }

    fun delete(key: String) {

        stringRedisTemplate!!.delete(key)

        LOG.info("Key [{}] has been deleted from Redis server", key)
    }

    companion object {

        private val LOG = LoggerFactory.getLogger(RedisClient::class.java)
    }

}

Refactor Redis client more Kotlin like

package org.paradise.ipaq.services.redis

import org.springframework.data.redis.RedisSystemException
import org.springframework.data.redis.core.StringRedisTemplate
import org.springframework.stereotype.Component

/**
 * Created by terrence on 25/5/17.
 */
@Component
class RedisClient(val stringRedisTemplate: StringRedisTemplate) {

    val valueOperations = stringRedisTemplate.opsForValue()!!

    fun persist(key: String, value: String): String {

        valueOperations.set(key, value)

        return valueOperations.get(key) ?: throw RedisSystemException("Redis Server persistence error", null)
    }

    fun get(key: String): String = valueOperations.get(key)

    fun delete(key: String) = stringRedisTemplate.delete(key)

}


/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

object AndroidComponents {
    const val VERSION = "95.0.20211026143215"
}

Update Android Components version to 95.0.20211101155331.

/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

object AndroidComponents {
    const val VERSION = "95.0.20211101155331"
}


Add test case proving Action overloads are correctly selected

package org.gradle.script.lang.kotlin

import com.nhaarman.mockito_kotlin.KStubbing
import com.nhaarman.mockito_kotlin.any
import com.nhaarman.mockito_kotlin.doReturn
import com.nhaarman.mockito_kotlin.mock
import com.nhaarman.mockito_kotlin.verify

import org.gradle.api.Action
import org.gradle.api.artifacts.ComponentSelection
import org.gradle.api.artifacts.ComponentSelectionRules
import org.gradle.api.artifacts.Configuration
import org.gradle.api.artifacts.ConfigurationContainer
import org.gradle.api.artifacts.ResolutionStrategy

import org.junit.Test

class ComponentSelectionRulesTest {

    @Test
    fun `Action method overloads are correctly selected`() {

        val componentSelection = mock<ComponentSelection>()
        val componentSelectionRules = mock<ComponentSelectionRules> {
            acceptConfigurationActionFor(componentSelection, ComponentSelectionRules::all)
        }
        val resolutionStrategy = mock<ResolutionStrategy> {
            acceptConfigurationActionFor(componentSelectionRules, ResolutionStrategy::componentSelection)
        }
        val conf = mock<Configuration> {
            acceptConfigurationActionFor(resolutionStrategy, Configuration::resolutionStrategy)
        }
        val configurations = mock<ConfigurationContainer> {
            on { maybeCreate("conf") } doReturn conf
        }

        configurations {
            "conf" {
                resolutionStrategy {
                    it.componentSelection {
                        it.all { selection ->
                            selection.reject("all")
                        }
                    }
                }
            }
        }
        verify(componentSelection).reject("all")
    }

    private fun <T, E> KStubbing<T>.acceptConfigurationActionFor(element: E, method: T.(Action<E>) -> T) {
        on { method(any()) }.thenAnswer {
            it.getArgument<Action<E>>(0).execute(element)
            it.mock
        }
    }
}


plugins {
    id("gradlebuild.distribution.api-java")
}

dependencies {
    implementation(project(":base-services"))
    implementation(project(":logging"))
    implementation(project(":process-services"))
    implementation(project(":core-api"))
    implementation(project(":model-core"))
    implementation(project(":core"))
    implementation(project(":file-collections"))
    implementation(project(":plugins"))
    implementation(project(":dependency-management"))
    implementation(project(":publish"))
    implementation(project(":maven"))
    implementation(project(":security"))

    implementation(libs.groovy)
    implementation(libs.guava)
    implementation(libs.inject)

    testImplementation(project(":ivy"))
    testImplementation(testFixtures(project(":core")))

    testRuntimeOnly(testFixtures(project(":security")))
    testRuntimeOnly(project(":distributions-publishing")) {
        because("ProjectBuilder tests load services from a Gradle distribution.")
    }

    integTestDistributionRuntimeOnly(project(":distributions-publishing"))
}

strictCompile {
    ignoreRawTypes() // raw types used in public API
}

classycle {
    excludePatterns.add("org/gradle/plugins/signing/**")
}

integTest.usesJavadocCodeSnippets.set(true)

Add description for signing project

plugins {
    id("gradlebuild.distribution.api-java")
}

description = "Plugin for cryptographic signing of publications, artifacts or files."

dependencies {
    implementation(project(":base-services"))
    implementation(project(":logging"))
    implementation(project(":process-services"))
    implementation(project(":core-api"))
    implementation(project(":model-core"))
    implementation(project(":core"))
    implementation(project(":file-collections"))
    implementation(project(":plugins"))
    implementation(project(":dependency-management"))
    implementation(project(":publish"))
    implementation(project(":maven"))
    implementation(project(":security"))

    implementation(libs.groovy)
    implementation(libs.guava)
    implementation(libs.inject)

    testImplementation(project(":ivy"))
    testImplementation(testFixtures(project(":core")))

    testRuntimeOnly(testFixtures(project(":security")))
    testRuntimeOnly(project(":distributions-publishing")) {
        because("ProjectBuilder tests load services from a Gradle distribution.")
    }

    integTestDistributionRuntimeOnly(project(":distributions-publishing"))
}

strictCompile {
    ignoreRawTypes() // raw types used in public API
}

classycle {
    excludePatterns.add("org/gradle/plugins/signing/**")
}

integTest.usesJavadocCodeSnippets.set(true)


package de.geeksfactory.opacclient.utils

import org.json.JSONObject
import org.jsoup.Jsoup
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import org.jsoup.nodes.TextNode
import org.jsoup.select.Elements

val String.html: Document
    get() = Jsoup.parse(this)

val String.jsonObject: JSONObject
    get() = JSONObject(this)

operator fun Element.get(name: String): String = this.attr(name)

val Element.text: String
    get() = this.text()

val Elements.text: String
    get() = this.text()

val TextNode.text: String
    get() = this.text()

Add some Kotlin extension functions to simplify handling of JSONArrays

package de.geeksfactory.opacclient.utils

import org.json.JSONArray
import org.json.JSONObject
import org.jsoup.Jsoup
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import org.jsoup.nodes.TextNode
import org.jsoup.select.Elements

val String.html: Document
    get() = Jsoup.parse(this)

val String.jsonObject: JSONObject
    get() = JSONObject(this)

operator fun Element.get(name: String): String = this.attr(name)

val Element.text: String
    get() = this.text()

val Elements.text: String
    get() = this.text()

val TextNode.text: String
    get() = this.text()

// JSONArray extension functions
inline fun <reified T, R> JSONArray.map(transform: (T) -> R): List<R> =
        (0..length()).map { i -> transform(get(i) as T) }

inline fun <reified T> JSONArray.forEach(function: (T) -> Unit) =
        (0..length()).forEach { i -> function(get(i) as T) }


package com.macoscope.ketchuplunch.model.login

import android.content.Context
import com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAccountCredential
import com.google.api.client.util.ExponentialBackOff

open class GoogleCredentialWrapper(val context: Context) {

    private val scopes: List<String> = listOf("https://www.googleapis.com/auth/spreadsheets")

    val credential: GoogleAccountCredential = GoogleAccountCredential.usingOAuth2(
            context.applicationContext,
            scopes).setBackOff(ExponentialBackOff());

    fun setSelectedAccountName(accountName: String) {
        credential.selectedAccountName = accountName
    }
}

Add open modifier to getSelectedAccountName method

package com.macoscope.ketchuplunch.model.login

import android.content.Context
import com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAccountCredential
import com.google.api.client.util.ExponentialBackOff

open class GoogleCredentialWrapper(val context: Context) {

    private val scopes: List<String> = listOf("https://www.googleapis.com/auth/spreadsheets")

    val credential: GoogleAccountCredential = GoogleAccountCredential.usingOAuth2(
            context.applicationContext,
            scopes).setBackOff(ExponentialBackOff());

    open fun setSelectedAccountName(accountName: String) {
        credential.selectedAccountName = accountName
    }
}


package Gradle_Util_Performance

import Gradle_Util_Performance.buildTypes.AdHocPerformanceScenarioLinux
import Gradle_Util_Performance.buildTypes.AdHocPerformanceScenarioMacOS
import Gradle_Util_Performance.buildTypes.AdHocPerformanceScenarioWindows
import Gradle_Util_Performance.buildTypes.AdHocPerformanceTestCoordinatorLinux
import Gradle_Util_Performance.buildTypes.AdHocPerformanceTestCoordinatorMacOS
import Gradle_Util_Performance.buildTypes.AdHocPerformanceTestCoordinatorWindows
import jetbrains.buildServer.configs.kotlin.v2019_2.Project

object Project : Project({
    uuid = "fdc4f15a-e253-4744-a1b3-bcac37b18189"
    id("Gradle_Util_Performance")
    parentId("Gradle_Util")
    name = "Performance"

    buildType(AdHocPerformanceScenarioLinux)
    buildType(AdHocPerformanceScenarioWindows)
    buildType(AdHocPerformanceScenarioMacOS)
    buildType(AdHocPerformanceTestCoordinatorLinux)
    buildType(AdHocPerformanceTestCoordinatorWindows)
    buildType(AdHocPerformanceTestCoordinatorMacOS)
})

Add GE access key to Util/Performance

package Gradle_Util_Performance

import Gradle_Util_Performance.buildTypes.AdHocPerformanceScenarioLinux
import Gradle_Util_Performance.buildTypes.AdHocPerformanceScenarioMacOS
import Gradle_Util_Performance.buildTypes.AdHocPerformanceScenarioWindows
import Gradle_Util_Performance.buildTypes.AdHocPerformanceTestCoordinatorLinux
import Gradle_Util_Performance.buildTypes.AdHocPerformanceTestCoordinatorMacOS
import Gradle_Util_Performance.buildTypes.AdHocPerformanceTestCoordinatorWindows
import jetbrains.buildServer.configs.kotlin.v2019_2.Project

object Project : Project({
    uuid = "fdc4f15a-e253-4744-a1b3-bcac37b18189"
    id("Gradle_Util_Performance")
    parentId("Gradle_Util")
    name = "Performance"

    buildType(AdHocPerformanceScenarioLinux)
    buildType(AdHocPerformanceScenarioWindows)
    buildType(AdHocPerformanceScenarioMacOS)
    buildType(AdHocPerformanceTestCoordinatorLinux)
    buildType(AdHocPerformanceTestCoordinatorWindows)
    buildType(AdHocPerformanceTestCoordinatorMacOS)

    params {
        param("env.GRADLE_ENTERPRISE_ACCESS_KEY", "%ge.gradle.org.access.key%")
    }
})


package de.axelrindle.simplecoins.command

import de.axelrindle.pocketknife.PocketCommand
import de.axelrindle.simplecoins.CoinManager
import de.axelrindle.simplecoins.SimpleCoins
import org.bukkit.command.Command
import org.bukkit.command.CommandSender

internal class ReloadCommand : PocketCommand() {

    override fun getName(): String {
        return "reload"
    }

    override fun getDescription(): String {
        return "Reloads the configuration from disk."
    }

    override fun getPermission(): String {
        return "simplecoins.reload"
    }

    override fun getUsage(): String {
        return "/simplecoins reload"
    }

    override fun handle(sender: CommandSender, command: Command, args: Array<out String>): Boolean {
        sender.sendMessage("${SimpleCoins.prefix} §bReloading...")

        try {
            // unload the CoinManager
            CoinManager.close()

            // reload the config files and re-init the CoinManager
            SimpleCoins.instance!!.pocketConfig.apply {
                reload("config")
                reload("database")
            }
            CoinManager.init(SimpleCoins.instance!!.pocketConfig)

            sender.sendMessage("${SimpleCoins.prefix} §aDone.")
        } catch (e: Exception) {
            sender.sendMessage("${SimpleCoins.prefix} §cSomething went wrong! Check the console for more information.")
            e.printStackTrace()
        }

        return true
    }

    override fun sendHelp(sender: CommandSender) {
        sender.sendMessage(getUsage())
    }

}

Use reloadAll() to reload all config files

package de.axelrindle.simplecoins.command

import de.axelrindle.pocketknife.PocketCommand
import de.axelrindle.simplecoins.CoinManager
import de.axelrindle.simplecoins.SimpleCoins
import org.bukkit.command.Command
import org.bukkit.command.CommandSender

internal class ReloadCommand : PocketCommand() {

    override fun getName(): String {
        return "reload"
    }

    override fun getDescription(): String {
        return "Reloads the configuration from disk."
    }

    override fun getPermission(): String {
        return "simplecoins.reload"
    }

    override fun getUsage(): String {
        return "/simplecoins reload"
    }

    override fun handle(sender: CommandSender, command: Command, args: Array<out String>): Boolean {
        sender.sendMessage("${SimpleCoins.prefix} §bReloading...")

        try {
            // unload the CoinManager
            CoinManager.close()

            // reload the config files and re-init the CoinManager
            SimpleCoins.instance!!.apply {
                pocketConfig.reloadAll()
                CoinManager.init(pocketConfig)
            }

            sender.sendMessage("${SimpleCoins.prefix} §aDone.")
        } catch (e: Exception) {
            sender.sendMessage("${SimpleCoins.prefix} §cSomething went wrong! Check the console for more information.")
            e.printStackTrace()
        }

        return true
    }

    override fun sendHelp(sender: CommandSender) {
        sender.sendMessage(getUsage())
    }

}


/*
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.facebook.litho

/**
 * Backwards compatibility for a Kotlin Component to accept a [Style] and apply it to a Java Spec
 * Component. Using this builder method is the equivalent of setting all common props the Style
 * defines.
 */
fun <T : Component.Builder<T>> Component.Builder<T>.kotlinStyle(style: Style): T {
  style.applyToComponent(context!!.resourceResolver, component)
  return getThis()
}

Allow nullable Style in kotlinStyle

/*
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.facebook.litho

/**
 * Backwards compatibility for a Kotlin Component to accept a [Style] and apply it to a Java Spec
 * Component. Using this builder method is the equivalent of setting all common props the Style
 * defines.
 */
fun <T : Component.Builder<T>> Component.Builder<T>.kotlinStyle(style: Style?): T {
  style?.applyToComponent(context!!.resourceResolver, component)
  return getThis()
}


package com.sedsoftware.yaptalker.data

data class NewsItem(val summary: String, val topic: TopicItem)

data class ForumItem(val id: Int, val title: String, val image: String, val description: String,
    val lastTopic: TopicItem)

data class TopicItem(val id: Int, val title: String, val answers: Int, val views: Int, val uq: Int,
    val author: UserProfileShort, val date: String)

data class PostItem(val id: Int, val author: UserProfileShort, val date: String, val uq: String,
    val content: String)

data class UserProfileShort(val id: Int, val name: String)

data class UserProfileInfo(val shortInfo: UserProfileShort, val picture: String, val avatar: String,
    val messagesCount: Int, val uq: Int)


package exh.search

import exh.anyChar
import ru.lanwen.verbalregex.VerbalExpression

class Text: QueryComponent() {
    val components = mutableListOf<TextComponent>()

    fun asRegex(): VerbalExpression.Builder {
        val builder = VerbalExpression.regex()
        for(component in components) {
            when(component) {
                is StringTextComponent -> builder.then(component.value)
                is SingleWildcard -> builder.anyChar()
                is MultiWildcard -> builder.zeroOrMore()
            }
        }
        return builder
    }

    fun rawTextOnly() = components
            .filter { it is StringTextComponent }
            .joinToString(separator = "")
}

Fix some bugs in the search engine.

package exh.search

import exh.anyChar
import ru.lanwen.verbalregex.VerbalExpression

class Text: QueryComponent() {
    val components = mutableListOf<TextComponent>()

    fun asRegex(): VerbalExpression.Builder {
        val builder = VerbalExpression.regex()
        for(component in components) {
            when(component) {
                is StringTextComponent -> builder.then(component.value)
                is SingleWildcard -> builder.anyChar()
                is MultiWildcard -> builder.anything()
            }
        }
        return builder
    }

    fun rawTextOnly() = components
            .filter { it is StringTextComponent }
            .joinToString(separator = "", transform = {
                (it as StringTextComponent).value
            })
}


package com.elpassion.intelijidea.common.console

import com.intellij.execution.filters.InputFilter
import com.intellij.execution.ui.ConsoleViewContentType
import com.intellij.openapi.project.Project
import com.intellij.openapi.util.Pair
import java.util.regex.Pattern

class RemoteToLocalTranslatingInputFilter(private val project: Project) : InputFilter {

    private val pattern = Pattern.compile("$FILE_REGEX:$LINE_REGEX: $ERROR_REGEX", Pattern.MULTILINE)

    override fun applyFilter(text: String, contentType: ConsoleViewContentType): MutableList<Pair<String, ConsoleViewContentType>> {
        return mutableListOf(Pair(translateText(text), contentType))
    }

    private fun translateText(text: String): String {
        val matcher = pattern.matcher(text)
        return if (!matcher.find()) {
            text
        } else {
            text.replace("\\D+mainframer/${project.name}".toRegex(), project.basePath!!)
        }
    }

    companion object {
        private val FILE_REGEX = "(^|[\\W])(?<file>(?:\\p{Alpha}\\:|/)[0-9 a-z_A-Z\\-\\\\./]+)"
        private val LINE_REGEX = "(?<line>[0-9]+)"
        private val ERROR_REGEX = "error: \\D+"
    }
}

Convert method to expression body

package com.elpassion.intelijidea.common.console

import com.intellij.execution.filters.InputFilter
import com.intellij.execution.ui.ConsoleViewContentType
import com.intellij.openapi.project.Project
import com.intellij.openapi.util.Pair
import java.util.regex.Pattern

class RemoteToLocalTranslatingInputFilter(private val project: Project) : InputFilter {

    private val pattern = Pattern.compile("$FILE_REGEX:$LINE_REGEX: $ERROR_REGEX", Pattern.MULTILINE)

    override fun applyFilter(text: String, contentType: ConsoleViewContentType) = mutableListOf(Pair(translateText(text), contentType))

    private fun translateText(text: String): String {
        val matcher = pattern.matcher(text)
        return if (!matcher.find()) {
            text
        } else {
            text.replace("\\D+mainframer/${project.name}".toRegex(), project.basePath!!)
        }
    }

    companion object {
        private val FILE_REGEX = "(^|[\\W])(?<file>(?:\\p{Alpha}\\:|/)[0-9 a-z_A-Z\\-\\\\./]+)"
        private val LINE_REGEX = "(?<line>[0-9]+)"
        private val ERROR_REGEX = "error: \\D+"
    }
}


@file:Suppress("unused")

package me.sieben.seventools.containers

import java.io.Serializable

data class Quad<out A, out B, out C, out D>(val first: A,
                                            val second: B,
                                            val third: C,
                                            val fourth: D) : Serializable {

    override fun toString() = "($first, $second, $third, $fourth)"
}

fun <T> Quad<T, T, T, T>.toList(): List<T> = listOf(first, second, third, fourth)

data class Quin<out A, out B, out C, out D, out E>(val first: A,
                                                   val second: B,
                                                   val third: C,
                                                   val fourth: D,
                                                   val fifth: E) : Serializable {

    override fun toString() = "($first, $second, $third, $fourth, $fifth)"
}

fun <T> Quin<T, T, T, T, T>.toList(): List<T> = listOf(first, second, third, fourth, fifth)

data class Hexa<out A, out B, out C, out D, out E, out F>(val first: A,
                                                          val second: B,
                                                          val third: C,
                                                          val fourth: D,
                                                          val fifth: E,
                                                          val sixth: F) : Serializable {

    override fun toString() = "($first, $second, $third, $fourth, $fifth, $sixth)"
}

fun <T> Hexa<T, T, T, T, T, T>.toList(): List<T> = listOf(first, second, third, fourth, fifth, sixth)

data class Sep<out A, out B, out C, out D, out E, out F, out G>(val first: A,
                                                                val second: B,
                                                                val third: C,
                                                                val fourth: D,
                                                                val fifth: E,
                                                                val sixth: F,
                                                                val seventh: G) : Serializable {

    override fun toString() = "($first, $second, $third, $fourth, $fifth, $sixth, $seventh)"
}

fun <T> Sep<T, T, T, T, T, T, T>.toList(): List<T> = listOf(first, second, third, fourth, fifth, sixth, seventh)


/*
 * Copyright 2014-2019 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
 */

package io.ktor.server.engine

import io.ktor.util.*
import kotlinx.coroutines.*
import org.slf4j.*
import java.io.*
import kotlin.coroutines.*

/**
 * Handles all uncaught exceptions and logs errors with the specified [logger]
 * ignoring [CancellationException] and [IOException].
 */
@EngineAPI
class DefaultUncaughtExceptionHandler(
    private val logger: () -> Logger
) : CoroutineExceptionHandler {
    constructor(logger: Logger) : this({ logger })

    override val key: CoroutineContext.Key<*>
        get() = CoroutineExceptionHandler.Key

    override fun handleException(context: CoroutineContext, exception: Throwable) {
        if (exception is CancellationException) return
        if (exception is IOException) return

        logger().error(exception)
    }
}

Improve unhandled coroutine exceptions logging

/*
 * Copyright 2014-2019 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
 */

package io.ktor.server.engine

import io.ktor.util.*
import kotlinx.coroutines.*
import org.slf4j.*
import java.io.*
import kotlin.coroutines.*

/**
 * Handles all uncaught exceptions and logs errors with the specified [logger]
 * ignoring [CancellationException] and [IOException].
 */
@EngineAPI
class DefaultUncaughtExceptionHandler(
    private val logger: () -> Logger
) : CoroutineExceptionHandler {
    constructor(logger: Logger) : this({ logger })

    override val key: CoroutineContext.Key<*>
        get() = CoroutineExceptionHandler.Key

    override fun handleException(context: CoroutineContext, exception: Throwable) {
        if (exception is CancellationException) return
        if (exception is IOException) return

        val coroutineName = context[CoroutineName] ?: context.toString()

        logger().error("Unhandled exception caught for $coroutineName", exception)
    }
}


/*
 * Copyright 2020 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package androidx.compose.foundation.layout.samples

import androidx.annotation.Sampled
import androidx.compose.foundation.Text
import androidx.compose.foundation.layout.relativePaddingFrom
import androidx.compose.foundation.text.FirstBaseline
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp

@Sampled
@Composable
fun RelativePaddingFromSample() {
    Text(
        text = "This is an example.",
        modifier = Modifier.relativePaddingFrom(FirstBaseline, before = 30.dp)
    )
}

Improve the sample of relativePaddingFrom

/*
 * Copyright 2020 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package androidx.compose.foundation.layout.samples

import androidx.annotation.Sampled
import androidx.compose.foundation.Text
import androidx.compose.foundation.layout.relativePaddingFrom
import androidx.compose.foundation.text.FirstBaseline
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.DensityAmbient
import androidx.compose.ui.unit.sp

@Sampled
@Composable
fun RelativePaddingFromSample() {
    // We want to have 30.sp distance from the top of the layout box to the baseline of the
    // first line of text.
    val distanceToBaseline = 30.sp
    // We convert the 30.sp value to dps, which is required for the relativePaddingFrom API.
    val distanceToBaselineDp = with(DensityAmbient.current) { distanceToBaseline.toDp() }
    // The result will be a layout with 30.sp distance from the top of the layout box to the
    // baseline of the first line of text.
    Text(
        text = "This is an example.",
        modifier = Modifier.relativePaddingFrom(FirstBaseline, before = distanceToBaselineDp)
    )
}


package com.emberjs.index

import com.emberjs.resolver.EmberName
import com.emberjs.utils.VoidHelper
import com.intellij.openapi.project.ProjectLocator
import com.intellij.openapi.vfs.VirtualFile
import com.intellij.util.indexing.*
import com.intellij.util.io.EnumeratorStringDescriptor

class EmberFileIndex() :
        ScalarIndexExtension<String>(),
        FileBasedIndex.InputFilter,
        DataIndexer<String, Void, FileContent> {

    override fun getName() = NAME
    override fun getVersion() = 1
    override fun getKeyDescriptor() = KEY_DESCRIPTIOR
    override fun dependsOnFileContent() = false

    override fun getInputFilter() = this
    override fun acceptInput(file: VirtualFile) =
            file.extension == "js" || file.extension == "hbs"

    override fun getIndexer() = this
    override fun map(inputData: FileContent): Map<String, Void> {
        val file = inputData.file
        val project = ProjectLocator.getInstance().guessProjectForFile(file) ?: return mapOf()
        val name = EmberName.from(project, file) ?: return mapOf()

        return mapOf(Pair(name.displayName, VoidHelper.get()))
    }

    companion object {
        val NAME: ID<String, Void> = ID.create("ember.files")
        val KEY_DESCRIPTIOR = EnumeratorStringDescriptor()
    }
}

Use module roots for indexing

package com.emberjs.index

import com.emberjs.project.EmberModuleType
import com.emberjs.resolver.EmberName
import com.emberjs.utils.VoidHelper
import com.intellij.openapi.module.ModuleType
import com.intellij.openapi.module.ModuleUtilCore
import com.intellij.openapi.project.ProjectLocator
import com.intellij.openapi.roots.ModuleRootManager
import com.intellij.openapi.vfs.VirtualFile
import com.intellij.util.indexing.*
import com.intellij.util.io.EnumeratorStringDescriptor

class EmberFileIndex() :
        ScalarIndexExtension<String>(),
        FileBasedIndex.InputFilter,
        DataIndexer<String, Void, FileContent> {

    override fun getName() = NAME
    override fun getVersion() = 2
    override fun getKeyDescriptor() = KEY_DESCRIPTIOR
    override fun dependsOnFileContent() = false

    override fun getInputFilter() = this
    override fun acceptInput(file: VirtualFile) =
            file.extension == "js" || file.extension == "hbs"

    override fun getIndexer() = this
    override fun map(inputData: FileContent): Map<String, Void> {
        val file = inputData.file
        val project = ProjectLocator.getInstance().guessProjectForFile(file) ?: return mapOf()
        val module = ModuleUtilCore.findModuleForFile(file, project) ?: return mapOf()

        if (ModuleType.get(module) !is EmberModuleType)
            return mapOf()

        return ModuleRootManager.getInstance(module).contentRoots
                .map { EmberName.from(it, file) }
                .filterNotNull()
                .toMap({ it.displayName }, { VoidHelper.get() })
    }

    companion object {
        val NAME: ID<String, Void> = ID.create("ember.files")
        val KEY_DESCRIPTIOR = EnumeratorStringDescriptor()
    }
}


import java.util.*

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`);

    val a: String = sc.next();
    val b: String = sc.next();

    println("X = " + (a.toInt() + b.toInt()));
}


import java.util.*

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`);

    sc.next();
    val b: Double = sc.next().toDouble();
    val c: Double = sc.next().toDouble();

    println("TOTAL = R$ %.2f".format(b + (c * 0.15)));
}


buildscript {
	repositories {
		mavenLocal()
		jcenter()
	}

	val kotlinVersion: String by project

	dependencies {
		classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
	}
}

repositories {
	jcenter()
}

apply {
	plugin("kotlin")
}

val assertjVersion: String by project
val usedDetektVersion: String by project
val junitEngineVersion: String by project
val junitPlatformVersion: String by project
val spekVersion: String by project

dependencies {
	implementation("io.gitlab.arturbosch.detekt:detekt-api:$usedDetektVersion")

	testImplementation("io.gitlab.arturbosch.detekt:detekt-test:$usedDetektVersion")
	testImplementation("org.junit.jupiter:junit-jupiter-api:$junitEngineVersion")
	testImplementation(kotlin("test"))
	testImplementation(kotlin("reflect"))
	testImplementation("org.assertj:assertj-core:$assertjVersion")
	testImplementation("org.jetbrains.spek:spek-api:$spekVersion")
	testImplementation("org.jetbrains.spek:spek-subject-extension:$spekVersion")
	testImplementation("org.junit.jupiter:junit-jupiter-engine:$junitEngineVersion")

	testRuntimeOnly("org.junit.platform:junit-platform-launcher:$junitPlatformVersion")
	testRuntimeOnly("org.jetbrains.spek:spek-junit-platform-engine:$spekVersion")
}

Remove redundant Kotlin plugin config


/*
 * Copyright 2015-2016 Paweł Gajda
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

@file:Suppress("NOTHING_TO_INLINE")

package com.pawegio.kandroid

import android.support.annotation.IdRes
import android.view.View
import android.view.View.*

inline fun <reified T : View> View.find(@IdRes id: Int): T = findViewById(id) as T

var View.visible
    get() = visibility == VISIBLE
    set(value) {
        visibility = if (value) VISIBLE else GONE
    }

inline fun View.hide(gone: Boolean = true) {
    visibility = if (gone) GONE else INVISIBLE
}

inline fun View.show() {
    visibility = VISIBLE
}

Add setHeight and setWidth methods to View

/*
 * Copyright 2015-2016 Paweł Gajda
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

@file:Suppress("NOTHING_TO_INLINE")

package com.pawegio.kandroid

import android.support.annotation.IdRes
import android.view.View
import android.view.View.*

inline fun <reified T : View> View.find(@IdRes id: Int): T = findViewById(id) as T

var View.visible
    get() = visibility == VISIBLE
    set(value) {
        visibility = if (value) VISIBLE else GONE
    }

inline fun View.hide(gone: Boolean = true) {
    visibility = if (gone) GONE else INVISIBLE
}

inline fun View.show() {
    visibility = VISIBLE
}

fun View.setHeight(height: Int) {
    val params = layoutParams
    params.height = height
    layoutParams = params
}

fun View.setWidth(width: Int) {
    val params = layoutParams
    params.width = width
    layoutParams = params
}


package net.squanchy.support.lang

import arrow.core.Option
import arrow.core.getOrElse

fun <T> Option<T>.or(value: T): T {
    return this.getOrElse { value }
}

fun <T> Option<T>.getOrThrow(): T {
    return this.getOrElse { throw IllegalStateException("You must check if data is present before using get()") }
}

Add option() extension fun to create optionals from nullables

package net.squanchy.support.lang

import arrow.core.Option
import arrow.core.getOrElse

fun <T> Option<T>.or(value: T): T = this.getOrElse { value }

fun <T> Option<T>.getOrThrow(): T = this.getOrElse {
    throw IllegalStateException("You must check if data is present before using get()")
}

fun <T> T?.option(): Option<T> = Option.fromNullable(this)


plugins {
  id("org.metaborg.gradle.config.root-project") version "0.3.21"
  id("org.metaborg.gitonium") version "0.1.3"

  // Set versions for plugins to use, only applying them in subprojects (apply false here).
  id("org.metaborg.spoofax.gradle.langspec") version "0.4.2" apply false
  id("de.set.ecj") version "1.4.1" apply false
}

subprojects {
  metaborg {
    configureSubProject()
  }
}

allprojects {
  // Override version from gitonium, as Spoofax Core uses a different versioning scheme.
  // Needs to be kept in sync with metaborgVersion of Spoofax 3 and the Spoofax 2 Gradle plugin.
  version = "2.5.11"
}

Update Spoofax 2 Gradle plugin.

plugins {
  id("org.metaborg.gradle.config.root-project") version "0.3.21"
  id("org.metaborg.gitonium") version "0.1.3"

  // Set versions for plugins to use, only applying them in subprojects (apply false here).
  id("org.metaborg.spoofax.gradle.langspec") version "0.4.4" apply false
  id("de.set.ecj") version "1.4.1" apply false
}

subprojects {
  metaborg {
    configureSubProject()
  }
}

allprojects {
  // Override version from gitonium, as Spoofax Core uses a different versioning scheme.
  // Needs to be kept in sync with metaborgVersion of Spoofax 3 and the Spoofax 2 Gradle plugin.
  version = "2.5.11"
}


package pl.elpassion.cloudtimer.adapter

import android.support.v7.widget.RecyclerView
import android.view.LayoutInflater
import android.view.ViewGroup
import java.util.*

open class BaseRecyclerViewAdapter : RecyclerView.Adapter<RecyclerView.ViewHolder>() {

    val adapters: MutableList<ItemAdapter<RecyclerView.ViewHolder>> = ArrayList()

    override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
        val adapter = adapters.first { it.itemViewType == viewType }
        val itemView = LayoutInflater.from(parent.context).inflate(adapter.itemViewType, parent, false)
        return adapter.onCreateViewHolder(itemView)
    }

    override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
        adapters[position].onBindBaseViewHolder(holder)
    }

    override fun getItemCount(): Int {
        return adapters.size
    }

    override fun getItemViewType(position: Int): Int {
        return adapters[position].itemViewType
    }
}

Revert "[refactoring] Remove unnecessary out."

package pl.elpassion.cloudtimer.adapter

import android.support.v7.widget.RecyclerView
import android.view.LayoutInflater
import android.view.ViewGroup
import java.util.*

open class BaseRecyclerViewAdapter : RecyclerView.Adapter<RecyclerView.ViewHolder>() {

    val adapters: MutableList<ItemAdapter<out RecyclerView.ViewHolder>> = ArrayList()

    override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
        val adapter = adapters.first { it.itemViewType == viewType }
        val itemView = LayoutInflater.from(parent.context).inflate(adapter.itemViewType, parent, false)
        return adapter.onCreateViewHolder(itemView)
    }

    override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
        adapters[position].onBindBaseViewHolder(holder)
    }

    override fun getItemCount(): Int {
        return adapters.size
    }

    override fun getItemViewType(position: Int): Int {
        return adapters[position].itemViewType
    }
}


package me.mrkirby153.KirBot.command.executors.music

import me.mrkirby153.KirBot.command.CommandException
import me.mrkirby153.KirBot.command.args.CommandContext
import me.mrkirby153.KirBot.command.executors.CmdExecutor
import me.mrkirby153.KirBot.database.api.MusicSettings
import me.mrkirby153.KirBot.music.MusicManager
import me.mrkirby153.KirBot.user.Clearance
import me.mrkirby153.KirBot.utils.Context
import me.mrkirby153.KirBot.utils.getClearance

abstract class MusicCommand : CmdExecutor() {

    abstract fun exec(context: Context, cmdContext: CommandContext, musicData: MusicSettings)

    override fun execute(context: Context, cmdContext: CommandContext) {
        if (context.data.musicManager.adminOnly) {
            if (context.member.getClearance(context.guild).value < Clearance.SERVER_ADMINISTRATOR.value)
                throw CommandException("The DJ is in Admin-Only mode :cry:\n Only those with the `ADMINISTRATOR` role can control the music")
        }
        context.channel.sendTyping().queue()
        val settings = MusicManager.musicSettings[context.guild.id] ?: return
        exec(context, cmdContext, settings)
    }
}

Check if the DJ is enabled before executing commands

package me.mrkirby153.KirBot.command.executors.music

import me.mrkirby153.KirBot.command.CommandException
import me.mrkirby153.KirBot.command.args.CommandContext
import me.mrkirby153.KirBot.command.executors.CmdExecutor
import me.mrkirby153.KirBot.database.api.MusicSettings
import me.mrkirby153.KirBot.music.MusicManager
import me.mrkirby153.KirBot.user.Clearance
import me.mrkirby153.KirBot.utils.Context
import me.mrkirby153.KirBot.utils.getClearance

abstract class MusicCommand : CmdExecutor() {

    abstract fun exec(context: Context, cmdContext: CommandContext, musicData: MusicSettings)

    override fun execute(context: Context, cmdContext: CommandContext) {
        if (context.data.musicManager.adminOnly) {
            if (context.member.getClearance(context.guild).value < Clearance.SERVER_ADMINISTRATOR.value)
                throw CommandException("The DJ is in Admin-Only mode :cry:\n Only those with the `ADMINISTRATOR` role can control the music")
        }
        context.channel.sendTyping().queue()
        val settings = MusicManager.musicSettings[context.guild.id] ?: return
        if (settings.enabled)
            exec(context, cmdContext, settings)
    }
}


package androidx.build.importMaven

import org.jetbrains.kotlin.konan.target.KonanTarget

/**
 * Common configuration for KMP builds.
 */
internal object KmpConfig {
    /**
     * host machines where we support compiling KMP
     */
    val SUPPORTED_HOSTS = listOf(
        KonanTarget.LINUX_X64,
        KonanTarget.MACOS_ARM64,
        KonanTarget.MACOS_X64,
    )

    /**
     * Supported konan targets
     */
    val SUPPORTED_KONAN_TARGETS = listOf(
        KonanTarget.MACOS_ARM64,
        KonanTarget.MACOS_X64,
        KonanTarget.LINUX_ARM64,
        KonanTarget.LINUX_X64,
        KonanTarget.MINGW_X64,
        KonanTarget.MINGW_X86,
    )
}

Add ios konan targets to the download list

package androidx.build.importMaven

import org.jetbrains.kotlin.konan.target.KonanTarget

/**
 * Common configuration for KMP builds.
 */
internal object KmpConfig {
    /**
     * host machines where we support compiling KMP
     */
    val SUPPORTED_HOSTS = listOf(
        KonanTarget.LINUX_X64,
        KonanTarget.MACOS_ARM64,
        KonanTarget.MACOS_X64,
    )

    /**
     * Supported konan targets
     */
    val SUPPORTED_KONAN_TARGETS = listOf(
        KonanTarget.MACOS_ARM64,
        KonanTarget.MACOS_X64,
        KonanTarget.LINUX_ARM64,
        KonanTarget.LINUX_X64,
        KonanTarget.MINGW_X64,
        KonanTarget.MINGW_X86,
        KonanTarget.IOS_ARM64,
        KonanTarget.IOS_SIMULATOR_ARM64,
        KonanTarget.IOS_X64,
    )
}


/*
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.facebook.litho.transition

import com.facebook.litho.ComponentScope
import com.facebook.litho.Transition
import com.facebook.rendercore.transitions.TransitionUtils

/** Defines single or multiple [Transition] animations for the given component */
fun ComponentScope.useTransition(transition: Transition?) {
  transition ?: return
  TransitionUtils.setOwnerKey(transition, context.globalKey)
  val transitionsList = transitions ?: ArrayList<Transition>()
  transitionsList.add(transition)
  transitions = transitionsList
}

Add missing Hook annotation to useTransition

/*
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.facebook.litho.transition

import com.facebook.litho.ComponentScope
import com.facebook.litho.Transition
import com.facebook.litho.annotations.Hook
import com.facebook.rendercore.transitions.TransitionUtils

/** Defines single or multiple [Transition] animations for the given component */
@Hook
fun ComponentScope.useTransition(transition: Transition?) {
  transition ?: return
  TransitionUtils.setOwnerKey(transition, context.globalKey)
  val transitionsList = transitions ?: ArrayList<Transition>()
  transitionsList.add(transition)
  transitions = transitionsList
}


/*
 * Copyright 2020 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package configurations

import common.VersionedSettingsBranch

val triggerExcludes = """
        -:.idea
        -:.github
        -:.teamcity
        -:subprojects/docs/src/docs/release
""".trimIndent()

fun VersionedSettingsBranch.branchFilter() = """
    +:$branchName
""".trimIndent()

fun branchesFilterExcluding(vararg excludedBranch: String) = """
+:*
-:<default>
${excludedBranch.joinToString("\n") { "-:$it" }}
"""

Remove default branch from vcs exclusion list

/*
 * Copyright 2020 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package configurations

import common.VersionedSettingsBranch

val triggerExcludes = """
        -:.idea
        -:.github
        -:.teamcity
        -:subprojects/docs/src/docs/release
""".trimIndent()

fun VersionedSettingsBranch.branchFilter() = """
    +:$branchName
""".trimIndent()

fun branchesFilterExcluding(vararg excludedBranch: String) = """
+:*
${excludedBranch.joinToString("\n") { "-:$it" }}
"""


package ir.alilo.virustotalclient.features.applist

import ir.alilo.virustotalclient.datasources.db.App
import ir.alilo.virustotalclient.mvp.Presenter
import javax.inject.Inject

class AppListPresenter @Inject constructor(view: AppListView?, interactor: AppListInteractor) :
        Presenter<AppListPresenter.AppListView, AppListInteractor>(view, interactor),
        AppListInteractor.AppListListener {
    companion object {
        val REQUEST_SYSTEM = 0
        val REQUEST_NON_SYSTEM = 0
    }

    init {
        interactor.listener = this
    }

    fun loadApps(system: Boolean) {
        view?.showLoading()
        interactor?.fetchApps(system, if (system) REQUEST_SYSTEM else REQUEST_NON_SYSTEM)
    }

    fun reloadApps(system: Boolean) {
        view?.showLoading()
        view?.clearApps()
        interactor?.fetchApps(system, if (system) REQUEST_SYSTEM else REQUEST_NON_SYSTEM)
    }

    override fun onAppsRetrieved(apps: List<App>, requestCode: Int) {
        view?.showApps(apps)
        view?.hideLoading()
    }

    interface AppListView {
        fun showLoading()
        fun hideLoading()
        fun showApps(apps: List<App>)
        fun clearApps()
    }
}

Fix app list request code issus

package ir.alilo.virustotalclient.features.applist

import ir.alilo.virustotalclient.datasources.db.App
import ir.alilo.virustotalclient.mvp.Presenter
import javax.inject.Inject

class AppListPresenter @Inject constructor(view: AppListView?, interactor: AppListInteractor) :
        Presenter<AppListPresenter.AppListView, AppListInteractor>(view, interactor),
        AppListInteractor.AppListListener {
    companion object {
        val REQUEST_SYSTEM = 0
        val REQUEST_NON_SYSTEM = 1
    }

    init {
        interactor.listener = this
    }

    fun loadApps(system: Boolean) {
        view?.showLoading()
        interactor?.fetchApps(system, if (system) REQUEST_SYSTEM else REQUEST_NON_SYSTEM)
    }

    fun reloadApps(system: Boolean) {
        view?.showLoading()
        view?.clearApps()
        interactor?.fetchApps(system, if (system) REQUEST_SYSTEM else REQUEST_NON_SYSTEM)
    }

    override fun onAppsRetrieved(apps: List<App>, requestCode: Int) {
        view?.showApps(apps)
        view?.hideLoading()
    }

    interface AppListView {
        fun showLoading()
        fun hideLoading()
        fun showApps(apps: List<App>)
        fun clearApps()
    }
}


Introduce a class registry capable of class lazy resolving

/*
 * Copyright 2015 Michael Rozumyanskiy
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package io.michaelrocks.lightsaber.processor.files

import io.michaelrocks.lightsaber.processor.descriptors.ClassDescriptor
import org.objectweb.asm.ClassReader
import org.objectweb.asm.ClassVisitor
import org.objectweb.asm.Opcodes
import org.objectweb.asm.Type
import java.util.*

interface ClassRegistry {
  fun findClass(type: Type): ClassDescriptor
  fun findClassHierarchy(type: Type): Sequence<ClassDescriptor>
}

class ClassRegistryImpl(private val fileRegistry: FileRegistry) : ClassRegistry {
  private val resolvedClasses = HashMap<Type, ClassDescriptor>()

  override fun findClass(type: Type): ClassDescriptor {
    return resolvedClasses.getOrPut(type) {
      val data = fileRegistry.readClass(type)
      val reader = ClassReader(data)
      val visitor = ClassDescriptorReader()
      reader.accept(visitor, ClassReader.SKIP_CODE or ClassReader.SKIP_DEBUG or ClassReader.SKIP_FRAMES)
      visitor.descriptor
    }
  }

  override fun findClassHierarchy(type: Type): Sequence<ClassDescriptor> {
    return sequence(findClass(type)) {
      it.superType?.let { findClass(it) }
    }
  }

  private class ClassDescriptorReader : ClassVisitor(Opcodes.ASM5) {
    lateinit var descriptor: ClassDescriptor

    override fun visit(version: Int, access: Int, name: String, signature: String?, superName: String?,
        interfaces: Array<String>?) {
      descriptor = ClassDescriptor(access, name, superName, interfaces)
    }
  }
}


/*
 * Copyright 2020-2021 Louis Cognault Ayeva Derman. Use of this source code is governed by the Apache 2.0 license.
 */

package splitties.coroutines

import kotlinx.coroutines.CancellationException
import kotlinx.coroutines.awaitCancellation as kotlinxCoroutinesAwaitCancellation

/**
 * **THIS FUNCTION WILL BE REMOVED because it's now included right into kotlinx.coroutines.**
 *
 * Suspends until cancellation, in which case it will throw a [CancellationException].
 *
 * Handy because it returns [Nothing], allowing it to be used in any coroutine,
 * regardless of the required return type.
 *
 * NOTE: Will be deprecated then removed once [this PR](https://github.com/Kotlin/kotlinx.coroutines/pull/2225)
 * makes it into a kotlinx.coroutines release.
 */
@Deprecated(
    message = "awaitCancellation() is now included right into kotlinx.coroutines. " +
        "This symbol will be removed before the 3.0.0 release of Splitties.",
    level = DeprecationLevel.WARNING,
    replaceWith = ReplaceWith("awaitCancellation()", "kotlinx.coroutines.awaitCancellation")
)
@FutureOverlapWithKotlinXCoroutines
suspend inline fun awaitCancellation(): Nothing = kotlinxCoroutinesAwaitCancellation()

Advance deprecation cycle of awaitCancellation()

/*
 * Copyright 2020-2021 Louis Cognault Ayeva Derman. Use of this source code is governed by the Apache 2.0 license.
 */

package splitties.coroutines

import kotlinx.coroutines.CancellationException
import kotlinx.coroutines.awaitCancellation as kotlinxCoroutinesAwaitCancellation

/**
 * **THIS FUNCTION WILL BE REMOVED because it's now included right into kotlinx.coroutines.**
 *
 * Suspends until cancellation, in which case it will throw a [CancellationException].
 *
 * Handy because it returns [Nothing], allowing it to be used in any coroutine,
 * regardless of the required return type.
 *
 * NOTE: Will be deprecated then removed once [this PR](https://github.com/Kotlin/kotlinx.coroutines/pull/2225)
 * makes it into a kotlinx.coroutines release.
 */
@Deprecated(
    message = "awaitCancellation() is now included right into kotlinx.coroutines. " +
        "This symbol will be removed before the 3.0.0 release of Splitties.",
    level = DeprecationLevel.ERROR,
    replaceWith = ReplaceWith("awaitCancellation()", "kotlinx.coroutines.awaitCancellation")
)
@FutureOverlapWithKotlinXCoroutines
suspend inline fun awaitCancellation(): Nothing = kotlinxCoroutinesAwaitCancellation()


package com.github.pgutkowski.kgraphql.schema.dsl

import com.fasterxml.jackson.databind.DeserializationFeature
import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
import com.github.pgutkowski.kgraphql.configuration.SchemaConfiguration
import kotlinx.coroutines.experimental.CommonPool

class SchemaConfigurationDSL {
    var useDefaultPrettyPrinter: Boolean = false
    var useCachingDocumentParser: Boolean = true
    var objectMapper: ObjectMapper = jacksonObjectMapper()
    var documentParserCacheMaximumSize : Long = 1000L
    var acceptSingleValueAsArray : Boolean = true
    var coroutineDispatcher = CommonPool

    internal fun update(block : SchemaConfigurationDSL.() -> Unit) = block()

    internal fun build() : SchemaConfiguration {
        objectMapper.configure(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY, acceptSingleValueAsArray)
        return SchemaConfiguration (
                useCachingDocumentParser,
                documentParserCacheMaximumSize,
                objectMapper,
                useDefaultPrettyPrinter,
                coroutineDispatcher
        )
    }
}

Make couroutineDispatcher type in configuration generic

package com.github.pgutkowski.kgraphql.schema.dsl

import com.fasterxml.jackson.databind.DeserializationFeature
import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
import com.github.pgutkowski.kgraphql.configuration.SchemaConfiguration
import kotlinx.coroutines.experimental.CommonPool
import kotlinx.coroutines.experimental.CoroutineDispatcher

class SchemaConfigurationDSL {
    var useDefaultPrettyPrinter: Boolean = false
    var useCachingDocumentParser: Boolean = true
    var objectMapper: ObjectMapper = jacksonObjectMapper()
    var documentParserCacheMaximumSize : Long = 1000L
    var acceptSingleValueAsArray : Boolean = true
    var coroutineDispatcher: CoroutineDispatcher = CommonPool

    internal fun update(block : SchemaConfigurationDSL.() -> Unit) = block()

    internal fun build() : SchemaConfiguration {
        objectMapper.configure(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY, acceptSingleValueAsArray)
        return SchemaConfiguration (
                useCachingDocumentParser,
                documentParserCacheMaximumSize,
                objectMapper,
                useDefaultPrettyPrinter,
                coroutineDispatcher
        )
    }
}


package venus.riscv

/** A singleton containing constants which say where various segments start */
object MemorySegments {
    /** Memory address where the stack segment starts (growing downwards) */
    const val STACK_BEGIN = 0x7fff_fffc
    /** Memory address where the heap segment starts */
    const val HEAP_BEGIN = 0x1000_8000
    /** Memory address where the data segment starts */
    const val STATIC_BEGIN = 0x1000_0000
    /**
     * Memory address where the text segment starts
     * @fixme a bug currently prevents TEXT_BEGIN from being anything other than 0
     */
    const val TEXT_BEGIN = 0x0000_0000
}

Update to make stack pointer 16-byte aligned

package venus.riscv

/** A singleton containing constants which say where various segments start */
object MemorySegments {
    /** Memory address where the stack segment starts (growing downwards) */
    const val STACK_BEGIN = 0x7fff_fff0
    /** Memory address where the heap segment starts */
    const val HEAP_BEGIN = 0x1000_8000
    /** Memory address where the data segment starts */
    const val STATIC_BEGIN = 0x1000_0000
    /**
     * Memory address where the text segment starts
     * @fixme a bug currently prevents TEXT_BEGIN from being anything other than 0
     */
    const val TEXT_BEGIN = 0x0000_0000
}


package com.github.ktoolz.model

import javaslang.collection.List
import java.io.File

/**
 * Store a search result
 */
data class SearchResult(val score: Int, val file: File) {
    val filename: String by lazy { file.name }
}

data class SearchQuery(val term: String, val contexts: List<String>, val directories: List<String>)

Convert filter query from String to dedicated object (FilterQuery). A filter query can be negated or not

package com.github.ktoolz.model

import javaslang.collection.List
import java.io.File

/**
 * Store a search result
 */
data class SearchResult(val score: Int, val file: File) {
    val filename: String by lazy { file.name }
}

data class FilterQuery(val name: String, val negated: Boolean = false)

data class SearchQuery(val term: String, val contexts: List<FilterQuery>, val directories: List<String>)


Add comment handler plugin implementation

import android.content.Context
import android.text.Editable
import android.text.Spannable
import org.wordpress.aztec.Constants
import org.wordpress.aztec.R
import org.wordpress.aztec.plugins.IAztecPlugin
import org.wordpress.aztec.plugins.html2visual.IAztecCommentHandler
import org.wordpress.aztec.plugins.wpcomments.spans.WordPressCommentSpan
import org.wordpress.aztec.spans.AztecCommentSpan

class WordPressCommentsPlugin : IAztecPlugin, IAztecCommentHandler {

    override fun handleComment(text: String, output: Editable, context: Context, nestingLevel: Int) {

        val spanStart = output.length

        if (text.toLowerCase() == AztecCommentSpan.Comment.MORE.html.toLowerCase()) {

            output.append(Constants.MAGIC_CHAR)

            output.setSpan(
                    WordPressCommentSpan(
                            text,
                            context,
                            context.resources.getDrawable(R.drawable.img_more),
                            nestingLevel
                    ),
                    spanStart,
                    text.length,
                    Spannable.SPAN_EXCLUSIVE_EXCLUSIVE
            )
        } else if (text.toLowerCase() == AztecCommentSpan.Comment.PAGE.html.toLowerCase()) {

            output.append(Constants.MAGIC_CHAR)

            output.setSpan(
                    WordPressCommentSpan(
                            text,
                            context,
                            context.resources.getDrawable(R.drawable.img_page),
                            nestingLevel
                    ),
                    spanStart,
                    text.length,
                    Spannable.SPAN_EXCLUSIVE_EXCLUSIVE
            )
        }
    }
}


package io.clappr.player.base

import java.util.*

class Options(
        var source: String? = null,
        var mimeType: String? = null,
        @Deprecated(message = "Autoplay functionality will be removed from Player on June/15/2017",
                level = DeprecationLevel.WARNING)
        var autoPlay: Boolean = true,
        val options: HashMap<String, Any> = hashMapOf<String, Any>()) : MutableMap<String, Any> by options

enum class ClapprOption(val value: String) {
    /**
     * Media start position
     */
    START_AT("startAt"),
    /**
     * Poster URL
     */
    POSTER("poster"),
    /**
     * Inform the URL license if DRM is necessary
     */
    DRM_LICENSE_URL("drmLicenseUrl")
}

Make the IdPlugin get the subtitle files

package io.clappr.player.base

import java.util.*

class Options(
        var source: String? = null,
        var mimeType: String? = null,
        @Deprecated(message = "Autoplay functionality will be removed from Player on June/15/2017",
                level = DeprecationLevel.WARNING)
        var autoPlay: Boolean = true,
        val options: HashMap<String, Any> = hashMapOf<String, Any>()) : MutableMap<String, Any> by options

enum class ClapprOption(val value: String) {
    /**
     * Media start position
     */
    START_AT("startAt"),
    /**
     * Poster URL
     */
    POSTER("poster"),
    /**
     * Inform the URL license if DRM is necessary
     */
    DRM_LICENSE_URL("drmLicenseUrl"),
    /**
     * List from subtitles URL`s
     */
    SUBTITLES("subtitles")
}


package cn.yiiguxing.plugin.translate.ui

import com.intellij.ide.ui.laf.IntelliJLaf
import com.intellij.ide.ui.laf.darcula.DarculaLaf
import com.intellij.openapi.util.IconLoader
import com.intellij.ui.IconManager
import com.intellij.util.ui.JBDimension
import java.awt.Container
import javax.swing.JFrame
import javax.swing.UIManager

internal fun uiTest(
    windowTitle: String,
    windowWidth: Int,
    windowHeight: Int,
    darcula: Boolean = false,
    uiProvider: (() -> Container)
) {
    IconLoader.activate()
    IconManager.activate(null)
    val laf = if (darcula) DarculaLaf() else IntelliJLaf()
    UIManager.setLookAndFeel(laf)

    val frame = JFrame(windowTitle)
    frame.contentPane = uiProvider()
    frame.size = JBDimension(windowWidth, windowHeight)
    frame.setLocationRelativeTo(null)
    frame.defaultCloseOperation = JFrame.EXIT_ON_CLOSE
    frame.isVisible = true
}

Fix too many arguments for `public open fun activate(): Unit` defined in `com.intellij.ui.IconManager`

package cn.yiiguxing.plugin.translate.ui

import com.intellij.ide.ui.laf.IntelliJLaf
import com.intellij.ide.ui.laf.darcula.DarculaLaf
import com.intellij.openapi.util.IconLoader
import com.intellij.ui.IconManager
import com.intellij.util.ui.JBDimension
import java.awt.Container
import javax.swing.JFrame
import javax.swing.UIManager

internal fun uiTest(
    windowTitle: String,
    windowWidth: Int,
    windowHeight: Int,
    darcula: Boolean = false,
    uiProvider: (() -> Container)
) {
    IconLoader.activate()
    @Suppress("UnstableApiUsage")
    IconManager.activate()
    val laf = if (darcula) DarculaLaf() else IntelliJLaf()
    UIManager.setLookAndFeel(laf)

    val frame = JFrame(windowTitle)
    frame.contentPane = uiProvider()
    frame.size = JBDimension(windowWidth, windowHeight)
    frame.setLocationRelativeTo(null)
    frame.defaultCloseOperation = JFrame.EXIT_ON_CLOSE
    frame.isVisible = true
}


package org.gradle.gradlebuild

import org.gradle.api.JavaVersion
import org.gradle.internal.os.OperatingSystem

object BuildEnvironment {
    val isCiServer = "CI" in System.getenv()
    val gradleKotlinDslVersion = "1.0-rc-11"
    val jvm = org.gradle.internal.jvm.Jvm.current()
    val javaVersion = JavaVersion.current()
    val isWindows = OperatingSystem.current().isWindows
    val isSlowInternetConnection
        get() = System.getProperty("slow.internet.connection", "false").toBoolean()
    val agentNum: Int
        get() {
            if (System.getenv().containsKey("USERNAME")) {
                val agentNumEnv = System.getenv("USERNAME").replaceFirst("tcagent", "")
                if (Regex("""\d+""").containsMatchIn(agentNumEnv)) {
                    return agentNumEnv.toInt()
                }
            }
            return 1
        }
}

Upgrade Kotlin DSL to 1.0-rc-12

package org.gradle.gradlebuild

import org.gradle.api.JavaVersion
import org.gradle.internal.os.OperatingSystem

object BuildEnvironment {
    val isCiServer = "CI" in System.getenv()
    val gradleKotlinDslVersion = "1.0-rc-12"
    val jvm = org.gradle.internal.jvm.Jvm.current()
    val javaVersion = JavaVersion.current()
    val isWindows = OperatingSystem.current().isWindows
    val isSlowInternetConnection
        get() = System.getProperty("slow.internet.connection", "false").toBoolean()
    val agentNum: Int
        get() {
            if (System.getenv().containsKey("USERNAME")) {
                val agentNumEnv = System.getenv("USERNAME").replaceFirst("tcagent", "")
                if (Regex("""\d+""").containsMatchIn(agentNumEnv)) {
                    return agentNumEnv.toInt()
                }
            }
            return 1
        }
}