mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-04 17:20:55 +07:00
Revert "UnstableTypeUsedInSignatureInspection: do not produce a warning in a annotated Kotlin file.
This reverts commit ad36f41a. @file:ApiStatus.Experimental does not mean that all classes\methods declared in this file are experimental, as it may seem naively. Instead, it only means that a class generated for top level declarations in the file (for file with name 'file.kt' class name will be 'FileKt') will be annotated but not other top-level classes in the file. GitOrigin-RevId: 5dadbf90aff8a0f421379f0e55786eac7848f201
This commit is contained in:
committed by
intellij-monorepo-bot
parent
b599be99b0
commit
444fede6e0
@@ -5,9 +5,8 @@ import com.intellij.analysis.JvmAnalysisBundle
|
||||
import com.intellij.codeInspection.AnnotatedApiUsageUtil.findAnnotatedTypeUsedInDeclarationSignature
|
||||
import com.intellij.codeInspection.UnstableApiUsageInspection.Companion.DEFAULT_UNSTABLE_API_ANNOTATIONS
|
||||
import com.intellij.codeInspection.util.SpecialAnnotationsUtil
|
||||
import com.intellij.psi.JavaPsiFacade
|
||||
import com.intellij.psi.PsiClass
|
||||
import com.intellij.psi.PsiField
|
||||
import com.intellij.lang.jvm.JvmModifier
|
||||
import com.intellij.psi.*
|
||||
import com.intellij.psi.util.PropertyUtil
|
||||
import com.intellij.uast.UastVisitorAdapter
|
||||
import com.intellij.util.ui.FormBuilder
|
||||
@@ -110,9 +109,6 @@ private class UnstableTypeUsedInSignatureVisitor(
|
||||
}
|
||||
val containingUFile = node.getContainingUFile()
|
||||
if (containingUFile != null) {
|
||||
if (containingUFile.annotations.any { it.qualifiedName in unstableApiAnnotations }) {
|
||||
return true
|
||||
}
|
||||
val packageName = containingUFile.packageName
|
||||
val psiPackage = JavaPsiFacade.getInstance(problemsHolder.project).findPackage(packageName)
|
||||
if (psiPackage != null) {
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
@file:[
|
||||
Suppress("UNUSED_PARAMETER")
|
||||
org.jetbrains.annotations.ApiStatus.Experimental
|
||||
]
|
||||
|
||||
// No warnings because the file itself is marked experimental.
|
||||
|
||||
package noWarnings
|
||||
|
||||
import test.ExperimentalClass;
|
||||
|
||||
fun topLevelMethodReturnType(): ExperimentalClass? = null
|
||||
fun topLevelParameterType(param: ExperimentalClass) {}
|
||||
val topLevelProperty: ExperimentalClass? = null
|
||||
|
||||
class NoWarnings<T : ExperimentalClass> {
|
||||
fun methodReturnType(): ExperimentalClass? = null
|
||||
fun parameterType(param: ExperimentalClass) {}
|
||||
val property: ExperimentalClass? = null
|
||||
}
|
||||
@@ -53,7 +53,6 @@ class UnstableTypeUsedInSignatureTest : JavaCodeInsightFixtureTestCase() {
|
||||
fun `test kotlin no extra warnings are produced`() {
|
||||
myFixture.testHighlighting("noWarnings/NoWarningsAlreadyMarked.kt")
|
||||
myFixture.testHighlighting("noWarnings/NoWarningsInaccessible.kt")
|
||||
myFixture.testHighlighting("noWarnings/NoWarningsKotlinFileMarked.kt")
|
||||
}
|
||||
|
||||
fun `test no warnings produced in experimental package`() {
|
||||
|
||||
Reference in New Issue
Block a user