diff --git a/build.gradle b/build.gradle index 4ac25b2..c1f40d3 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,6 @@ plugins { - id 'org.jetbrains.kotlin.jvm' version '1.4.20' - id 'org.jetbrains.kotlin.plugin.serialization' version '1.4.20' + id 'org.jetbrains.kotlin.jvm' version '1.5.0' + id 'org.jetbrains.kotlin.plugin.serialization' version '1.5.0' } group 'intro-coroutines' @@ -15,7 +15,7 @@ dependencies { implementation "org.jetbrains.kotlin:kotlin-reflect" implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.0.1") - def coroutines_version = '1.4.2' + def coroutines_version = '1.5.0' implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version" implementation "org.jetbrains.kotlinx:kotlinx-coroutines-swing:$coroutines_version" implementation "org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:$coroutines_version" diff --git a/src/contributors/ContributorsUI.kt b/src/contributors/ContributorsUI.kt index 8d73bcc..1077377 100644 --- a/src/contributors/ContributorsUI.kt +++ b/src/contributors/ContributorsUI.kt @@ -145,7 +145,7 @@ fun JPanel.addWideSeparator() { fun setDefaultFontSize(size: Float) { for (key in UIManager.getLookAndFeelDefaults().keys.toTypedArray()) { - if (key.toString().toLowerCase().contains("font")) { + if (key.toString().lowercase().contains("font")) { val font = UIManager.getDefaults().getFont(key) ?: continue val newFont = font.deriveFont(size) UIManager.put(key, newFont) diff --git a/src/tasks/Aggregation.kt b/src/tasks/Aggregation.kt index 145b344..8565e08 100644 --- a/src/tasks/Aggregation.kt +++ b/src/tasks/Aggregation.kt @@ -16,5 +16,5 @@ TODO: Write aggregation code. */ fun List.aggregate(): List = groupBy { it.login } - .map { (login, group) -> User(login, group.sumBy { it.contributions }) } + .map { (login, group) -> User(login, group.sumOf { it.contributions }) } .sortedByDescending { it.contributions } \ No newline at end of file diff --git a/src/tasks/Request5NotCancellable.kt b/src/tasks/Request5NotCancellable.kt index 87bac9a..efe549d 100644 --- a/src/tasks/Request5NotCancellable.kt +++ b/src/tasks/Request5NotCancellable.kt @@ -4,6 +4,7 @@ import contributors.* import kotlinx.coroutines.* import kotlin.coroutines.coroutineContext +@OptIn(DelicateCoroutinesApi::class) suspend fun loadContributorsNotCancellable(service: GitHubService, req: RequestData): List { val repos = service .getOrgRepos(req.org)