[KAPT] KT-64297 Mark deprecated members with @java.lang.Deprecated

Merge-request: KT-MR-13521
Merged-by: Pavel Mikhailovskii <Pavel.Mikhailovskii@jetbrains.com>
This commit is contained in:
strangepleasures
2023-12-13 17:18:54 +00:00
committed by Space Team
parent 34bf32866b
commit b84aa190d7
4 changed files with 99 additions and 1 deletions
@@ -477,8 +477,17 @@ private class StubGenerator(
private fun Printer.printModifiers(modifierListOwner: PsiModifierListOwner) {
val withIndentation = modifierListOwner !is PsiParameter
var isDeprecated = (modifierListOwner as? PsiDocCommentOwner)?.isDeprecated == true
var hasJavaDeprecated = false
for (annotation in modifierListOwner.annotations) {
printAnnotation(annotation, withIndentation)
isDeprecated = isDeprecated || (annotation.qualifiedName == "kotlin.Deprecated")
hasJavaDeprecated = hasJavaDeprecated || (annotation.qualifiedName == "java.lang.Deprecated")
}
if (isDeprecated && !hasJavaDeprecated) {
if (withIndentation)
println("@java.lang.Deprecated")
else printWithNoIndent("@java.lang.Deprecated ")
}
if (withIndentation) printIndent()