Replace deprecated annotations in whole project
This commit is contained in:
@@ -224,7 +224,7 @@ public open class JetPsiChecker : Annotator, HighlightRangeExtension {
|
||||
|
||||
companion object {
|
||||
var namesHighlightingEnabled = true
|
||||
[TestOnly] set
|
||||
@TestOnly set
|
||||
|
||||
platformStatic fun highlightName(holder: AnnotationHolder, psiElement: PsiElement, attributesKey: TextAttributesKey) {
|
||||
if (namesHighlightingEnabled) {
|
||||
|
||||
@@ -63,7 +63,7 @@ public abstract class AbstractJetReference<T : JetElement>(element: T)
|
||||
|
||||
override fun bindToElement(element: PsiElement): PsiElement = throw IncorrectOperationException()
|
||||
|
||||
[suppress("CAST_NEVER_SUCCEEDS")]
|
||||
@suppress("CAST_NEVER_SUCCEEDS")
|
||||
override fun getVariants(): Array<Any> = PsiReference.EMPTY_ARRAY as Array<Any>
|
||||
|
||||
override fun isSoft(): Boolean = false
|
||||
|
||||
+3
-3
@@ -59,9 +59,9 @@ public class JetReferenceContributor() : PsiReferenceContributor() {
|
||||
) {
|
||||
registerReferenceProvider(PlatformPatterns.psiElement(elementClass), object: PsiReferenceProvider() {
|
||||
override fun getReferencesByElement(element: PsiElement, context: ProcessingContext): Array<PsiReference> {
|
||||
[suppress("UNCHECKED_CAST")]
|
||||
return array(factory(element as E))
|
||||
}
|
||||
@suppress("UNCHECKED_CAST")
|
||||
return array(factory(element as E))
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -69,6 +69,6 @@ val (PsiReference.() -> Boolean).searchFilter: UsagesSearchFilter
|
||||
|
||||
val <T: PsiNamedElement> (PsiReference.(T) -> Boolean).searchFilter: UsagesSearchFilter
|
||||
get() = object: UsagesSearchFilter {
|
||||
[suppress("UNCHECKED_CAST")]
|
||||
@suppress("UNCHECKED_CAST")
|
||||
override fun accepts(ref: PsiReference, item: UsagesSearchRequestItem): Boolean = ref.this@searchFilter(item.target.element as T)
|
||||
}
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@ public class KotlinInheritedMembersNodeProvider: InheritedMembersNodeProvider<Tr
|
||||
val element = node.getElement()
|
||||
if (element !is JetClassOrObject) return listOf()
|
||||
|
||||
[suppress("USELESS_CAST")] // KT-3996 Workaround
|
||||
@suppress("USELESS_CAST") // KT-3996 Workaround
|
||||
val project = (element as NavigatablePsiElement).getProject()
|
||||
|
||||
val context = element.analyze()
|
||||
|
||||
@@ -39,6 +39,6 @@ public fun Project.executeCommand(name: String, groupId: Any? = null, command: (
|
||||
public fun <T> Project.executeWriteCommand(name: String, groupId: Any? = null, command: () -> T): T {
|
||||
var result: T = null as T
|
||||
CommandProcessor.getInstance().executeCommand(this, { result = runWriteAction(command) }, name, groupId)
|
||||
[suppress("USELESS_CAST")]
|
||||
@suppress("USELESS_CAST")
|
||||
return result as T
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ public abstract class ImportInsertHelper {
|
||||
public abstract fun importDescriptor(file: JetFile, descriptor: DeclarationDescriptor): ImportDescriptorResult
|
||||
|
||||
companion object {
|
||||
[platformStatic]
|
||||
@platformStatic
|
||||
public fun getInstance(project: Project): ImportInsertHelper
|
||||
= ServiceManager.getService<ImportInsertHelper>(project, javaClass<ImportInsertHelper>())
|
||||
}
|
||||
|
||||
@@ -162,7 +162,7 @@ fun<TDescriptor: DeclarationDescriptor?> MutableCollection<LookupElement>.addLoo
|
||||
for (info in expectedInfos) {
|
||||
val classification = infoClassifier(info)
|
||||
if (classification.substitutor != null) {
|
||||
[suppress("UNCHECKED_CAST")]
|
||||
@suppress("UNCHECKED_CAST")
|
||||
val substitutedDescriptor = descriptor?.substitute(classification.substitutor) as TDescriptor
|
||||
val map = if (classification.makeNotNullable) makeNullableInfos else matchedInfos
|
||||
map.getOrPut(ItemData(substitutedDescriptor, info.itemOptions)) { ArrayList() }.add(info)
|
||||
|
||||
@@ -277,7 +277,7 @@ public class KotlinCopyPasteReferenceProcessor() : CopyPastePostProcessor<Kotlin
|
||||
val importHelper = ImportInsertHelper.getInstance(file.getProject())
|
||||
val smartPointerManager = SmartPointerManager.getInstance(file.getProject())
|
||||
|
||||
[data] class BindingRequest(
|
||||
@data class BindingRequest(
|
||||
val pointer: SmartPsiElementPointer<JetSimpleNameExpression>,
|
||||
val fqName: FqName
|
||||
)
|
||||
@@ -347,7 +347,7 @@ public class KotlinCopyPasteReferenceProcessor() : CopyPastePostProcessor<Kotlin
|
||||
}
|
||||
|
||||
companion object {
|
||||
[TestOnly]
|
||||
@TestOnly
|
||||
public var declarationsToImportSuggested: Collection<String> = emptyList()
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ class KotlinSpellcheckingStrategy: SpellcheckingStrategy() {
|
||||
private val emptyTokenizer = SpellcheckingStrategy.EMPTY_TOKENIZER
|
||||
|
||||
override fun getTokenizer(element: PsiElement?): Tokenizer<out PsiElement?> {
|
||||
[suppress("UNCHECKED_CAST")]
|
||||
@suppress("UNCHECKED_CAST")
|
||||
return when {
|
||||
element is PsiNameIdentifierOwner || element is PsiComment ->
|
||||
super.getTokenizer(element)
|
||||
|
||||
@@ -268,7 +268,7 @@ public class JetPositionManager(private val myDebugProcess: DebugProcess) : Mult
|
||||
}
|
||||
}
|
||||
|
||||
[deprecated("Since Idea 14.0.3 use createPrepareRequests fun")]
|
||||
@deprecated("Since Idea 14.0.3 use createPrepareRequests fun")
|
||||
override fun createPrepareRequest(classPrepareRequestor: ClassPrepareRequestor, sourcePosition: SourcePosition): ClassPrepareRequest? {
|
||||
if (sourcePosition.getFile() !is JetFile) {
|
||||
throw NoDataException.INSTANCE
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@ public class JavaMethodKotlinDerivedDefinitionUsage(
|
||||
function: JetFunction,
|
||||
functionDescriptor: FunctionDescriptor,
|
||||
javaMethodChangeInfo: JetChangeInfo): JavaMethodKotlinUsageWithDelegate<JetFunction>(function, javaMethodChangeInfo) {
|
||||
[suppress("CAST_NEVER_SUCCEEDS")]
|
||||
@suppress("CAST_NEVER_SUCCEEDS")
|
||||
override protected val delegateUsage = JetFunctionDefinitionUsage(
|
||||
psiElement,
|
||||
functionDescriptor,
|
||||
|
||||
+1
-1
@@ -110,7 +110,7 @@ public class KotlinIntroduceParameterMethodUsageProcessor : IntroduceParameterMe
|
||||
val refElement = usage.getElement() as? JetReferenceExpression ?: return true
|
||||
val callElement = refElement.getParentOfTypeAndBranch<JetCallElement>(true) { getCalleeExpression() } ?: return true
|
||||
val delegateUsage = if (callElement is JetConstructorDelegationCall) {
|
||||
[suppress("CAST_NEVER_SUCCEEDS")]
|
||||
@suppress("CAST_NEVER_SUCCEEDS")
|
||||
(JetConstructorDelegationCallUsage(callElement, changeInfo) as JetUsageInfo<JetCallElement>)
|
||||
}
|
||||
else {
|
||||
|
||||
+1
-1
@@ -248,7 +248,7 @@ public abstract class AbstractJetExtractionTest() : JetLightCodeInsightFixtureTe
|
||||
|
||||
val extractionOptions = InTextDirectivesUtils.findListWithPrefixes(fileText, "// OPTIONS: ").let {
|
||||
if (it.isNotEmpty()) {
|
||||
[suppress("CAST_NEVER_SUCCEEDS")]
|
||||
@suppress("CAST_NEVER_SUCCEEDS")
|
||||
val args = it.map { it.toBoolean() }.copyToArray() as Array<Any?>
|
||||
javaClass<ExtractionOptions>().getConstructors().first { it.getParameterTypes().size() == args.size() }.newInstance(*args) as ExtractionOptions
|
||||
} else ExtractionOptions.DEFAULT
|
||||
|
||||
Reference in New Issue
Block a user