Minor: Drop unused code and inline utility
This commit is contained in:
@@ -57,6 +57,3 @@ public fun AnnotationDescriptor.argumentValue(parameterName: String): Any? {
|
||||
.singleOrNull { it.key.getName().asString() == parameterName }
|
||||
?.value?.getValue()
|
||||
}
|
||||
|
||||
public fun AnnotationDescriptor.deprecatedAnnotationMessage(): String?
|
||||
= argumentValue("value") as? String
|
||||
|
||||
+1
-4
@@ -26,12 +26,9 @@ import org.jetbrains.kotlin.diagnostics.Diagnostic
|
||||
import org.jetbrains.kotlin.diagnostics.Errors
|
||||
import org.jetbrains.kotlin.lexer.JetTokens
|
||||
import org.jetbrains.kotlin.name.FqName
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.psi.*
|
||||
import org.jetbrains.kotlin.resolve.BindingTrace
|
||||
import org.jetbrains.kotlin.resolve.DescriptorUtils
|
||||
import org.jetbrains.kotlin.resolve.annotations.argumentValue
|
||||
import org.jetbrains.kotlin.resolve.annotations.deprecatedAnnotationMessage
|
||||
|
||||
public class DeprecatedSymbolValidator : SymbolUsageValidator {
|
||||
private val JAVA_DEPRECATED = FqName(javaClass<Deprecated>().getName())
|
||||
@@ -91,7 +88,7 @@ public class DeprecatedSymbolValidator : SymbolUsageValidator {
|
||||
}
|
||||
|
||||
private fun createDeprecationDiagnostic(element: PsiElement, descriptor: DeclarationDescriptor, deprecated: AnnotationDescriptor): Diagnostic {
|
||||
val message = deprecated.deprecatedAnnotationMessage()
|
||||
val message = deprecated.argumentValue("value") as? String
|
||||
return if (message == null)
|
||||
Errors.DEPRECATED_SYMBOL.on(element, descriptor)
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user