Skip to content

Commit 95f336c

Browse files
authored
Merge pull request #14393 from igfoo/igfoo/no1.4
Kotlin: Remove 1.4 compatibility
2 parents 1c81c9b + d34b85c commit 95f336c

File tree

3 files changed

+2
-5
lines changed

3 files changed

+2
-5
lines changed

java/kotlin-extractor/src/main/kotlin/KotlinExtractorExtension.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@ class KotlinExtractorExtension(
168168
return defaultCompression
169169
} else {
170170
try {
171-
@OptIn(kotlin.ExperimentalStdlibApi::class) // Annotation required by kotlin versions < 1.5
172171
val compression_option_upper = compression_option.uppercase()
173172
if (compression_option_upper == "BROTLI") {
174173
logger.warn("Kotlin extractor doesn't support Brotli compression. Using GZip instead.")

java/kotlin-extractor/src/main/kotlin/KotlinFileExtractor.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ open class KotlinFileExtractor(
116116

117117
val exceptionOnFile = System.getenv("CODEQL_KOTLIN_INTERNAL_EXCEPTION_WHILE_EXTRACTING_FILE")
118118
if(exceptionOnFile != null) {
119-
@OptIn(kotlin.ExperimentalStdlibApi::class) // Annotation required by kotlin versions < 1.5
120119
if(exceptionOnFile.lowercase() == file.name.lowercase()) {
121120
throw Exception("Internal testing exception")
122121
}
@@ -403,7 +402,7 @@ open class KotlinFileExtractor(
403402
// Extract the outer <-> inner class relationship, passing on any type arguments in excess to this class' parameters if this is an inner class.
404403
// For example, in `class Outer<T> { inner class Inner<S> { } }`, `Inner<Int, String>` nests within `Outer<Int>` and raw `Inner<>` within `Outer<>`,
405404
// but for a similar non-`inner` (in Java terms, static nested) class both `Inner<Int>` and `Inner<>` nest within the unbound type `Outer`.
406-
val useBoundOuterType = (c.isInner || c.isLocal) && (c.parents.map { // Would use `firstNotNullOfOrNull`, but this doesn't exist in Kotlin 1.4
405+
val useBoundOuterType = (c.isInner || c.isLocal) && (c.parents.firstNotNullOfOrNull {
407406
when(it) {
408407
is IrClass -> when {
409408
it.typeParameters.isNotEmpty() -> true // Type parameters visible to this class -- extract an enclosing bound or raw type.
@@ -412,7 +411,7 @@ open class KotlinFileExtractor(
412411
}
413412
else -> null // Look through enclosing non-class entities (this may need to change)
414413
}
415-
}.firstOrNull { it != null } ?: false)
414+
} ?: false)
416415

417416
extractEnclosingClass(c.parent, id, c, locId, if (useBoundOuterType) argsIncludingOuterClasses?.drop(c.typeParameters.size) else listOf())
418417

java/kotlin-extractor/src/main/kotlin/utils/ClassNames.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import org.jetbrains.kotlin.load.kotlin.JvmPackagePartSource
2424
// for `that`.
2525
private fun getName(d: IrDeclarationWithName) = (d as? IrAnnotationContainer)?.let { getJvmName(it) } ?: d.name.asString()
2626

27-
@OptIn(ExperimentalStdlibApi::class) // Annotation required by kotlin versions < 1.5
2827
fun getFileClassName(f: IrFile) =
2928
getJvmName(f) ?:
3029
((f.fileEntry.name.replaceFirst(Regex(""".*[/\\]"""), "")

0 commit comments

Comments
 (0)