Replace deprecated usages of max/min with maxOrNull/minOrNull

This commit is contained in:
Alexander Udalov
2020-08-13 18:14:02 +02:00
parent 81dda96ece
commit a9ddf02556
48 changed files with 86 additions and 84 deletions
@@ -105,7 +105,7 @@ class KotlinMavenArchetypesProvider(private val kotlinPluginVersion: String, pri
}
private fun chooseVersion(versions: List<MavenArchetype>): MavenArchetype? {
return versions.maxBy { MavenVersionComparable(it.version) }
return versions.maxByOrNull { MavenVersionComparable(it.version) }
}
private fun <R> connectAndApply(url: String, timeoutSeconds: Int = 15, block: (HttpURLConnection) -> R): R {
@@ -73,7 +73,7 @@ class DifferentMavenStdlibVersionInspection : DomElementsInspection<MavenDomProj
}
private fun createFixes(project: MavenProject, versionElement: GenericDomValue<*>, versions: List<String>): List<SetVersionQuickFix> {
val bestVersion = versions.maxBy(::MavenVersionComparable)!!
val bestVersion = versions.maxByOrNull(::MavenVersionComparable)!!
if (bestVersion == versionElement.stringValue) {
return emptyList()
}