Skip to content

Commit 8f50cd3

Browse files
committed
fix: replace kotlin min() and max() deprecated functions with minOrNull()
1 parent f6e2a0d commit 8f50cd3

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

plugins/license-gather-plugin/src/main/kotlin/com/github/vlsi/gradle/license/api/LicenseExpression.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ fun LicenseExpression.weight(): Int =
160160
is JustLicense -> 1
161161
is OrLaterLicense -> 2
162162
is WithException -> license.weight() + 1
163-
is ConjunctionLicenseExpression -> licenses.map { it.weight() + 1 }.max() ?: 1
164-
is DisjunctionLicenseExpression -> licenses.map { it.weight() + 1 }.max() ?: 1
163+
is ConjunctionLicenseExpression -> licenses.map { it.weight() + 1 }.maxOrNull() ?: 1
164+
is DisjunctionLicenseExpression -> licenses.map { it.weight() + 1 }.maxOrNull() ?: 1
165165
else -> TODO("Unexpected expression: ${this::class.simpleName}: $this")
166166
}

plugins/stage-vote-release-plugin/src/main/kotlin/com/github/vlsi/gradle/release/Apache2LicenseInterpreter.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ class Apache2LicenseInterpreter {
4141
return when (e) {
4242
is DisjunctionLicenseExpression ->
4343
// A or X => A
44-
e.unordered.map { eval(it) }.min()
44+
e.unordered.map { eval(it) }.minOrNull()
4545
is ConjunctionLicenseExpression ->
46-
e.unordered.map { eval(it) }.max()
46+
e.unordered.map { eval(it) }.maxOrNull()
4747
else -> null
4848
} ?: AsfLicenseCategory.UNKNOWN
4949
}

plugins/stage-vote-release-plugin/src/main/kotlin/com/github/vlsi/gradle/release/StageVoteReleasePlugin.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ class StageVoteReleasePlugin @Inject constructor(private val instantiator: Insta
675675
Pair(listOf(), mapOf())
676676
}
677677

678-
val svnStagingRevision = stagedFiles.map { it.commit.revision }.max() ?: 0
678+
val svnStagingRevision = stagedFiles.map { it.commit.revision }.maxOrNull() ?: 0
679679

680680
val releaseParams = ReleaseParams(
681681
tlp = releaseExt.tlp.get(),

0 commit comments

Comments
 (0)