Replace deprecated annotations in whole project
This commit is contained in:
@@ -34,7 +34,7 @@ public object CodegenUtilKt {
|
||||
// toTrait = Bar
|
||||
// delegateExpressionType = typeof(baz)
|
||||
// return Map<member of Foo, corresponding member of typeOf(baz)>
|
||||
public [platformStatic] fun getDelegates(
|
||||
public platformStatic fun getDelegates(
|
||||
descriptor: ClassDescriptor,
|
||||
toTrait: ClassDescriptor,
|
||||
delegateExpressionType: JetType? = null
|
||||
|
||||
@@ -56,7 +56,7 @@ public fun <Function : FunctionHandle, Signature> generateBridges(
|
||||
// If it's a concrete fake override, some of the bridges may be inherited from the super-classes. Specifically, bridges for all
|
||||
// declarations that are reachable from all concrete immediate super-functions of the given function. Note that all such bridges are
|
||||
// guaranteed to delegate to the same implementation as bridges for the given function, that's why it's safe to inherit them
|
||||
[suppress("UNCHECKED_CAST")]
|
||||
@suppress("UNCHECKED_CAST")
|
||||
for (overridden in function.getOverridden() as Iterable<Function>) {
|
||||
if (!overridden.isAbstract) {
|
||||
bridgesToGenerate.removeAll(findAllReachableDeclarations(overridden).map(signature))
|
||||
@@ -77,7 +77,7 @@ private fun <Function : FunctionHandle> findAllReachableDeclarations(function: F
|
||||
}
|
||||
}
|
||||
}
|
||||
[suppress("UNCHECKED_CAST")]
|
||||
@suppress("UNCHECKED_CAST")
|
||||
DFS.dfs(listOf(function), { it.getOverridden() as Iterable<Function> }, collector)
|
||||
return HashSet(collector.result())
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ class PlatformStaticGenerator(
|
||||
}
|
||||
|
||||
companion object {
|
||||
[platformStatic]
|
||||
@platformStatic
|
||||
public fun createStaticFunctionDescriptor(descriptor: FunctionDescriptor): FunctionDescriptor {
|
||||
val memberDescriptor = if (descriptor is PropertyAccessorDescriptor) descriptor.getCorrespondingProperty() else descriptor
|
||||
val copies = CodegenUtil.copyFunctions(
|
||||
|
||||
@@ -21,7 +21,7 @@ import kotlin.platform.platformStatic
|
||||
|
||||
object SMAPParser {
|
||||
|
||||
[platformStatic]
|
||||
@platformStatic
|
||||
/*null smap means that there is no any debug info in file (e.g. sourceName)*/
|
||||
public fun parseOrCreateDefault(mappingInfo: String?, source: String?, path: String, methodStartLine: Int, methodEndLine: Int): SMAP {
|
||||
if (mappingInfo == null || mappingInfo.isEmpty()) {
|
||||
@@ -41,7 +41,7 @@ object SMAPParser {
|
||||
return parse(mappingInfo)
|
||||
}
|
||||
|
||||
[platformStatic]
|
||||
@platformStatic
|
||||
public fun parse(mappingInfo: String): SMAP {
|
||||
val fileMappings = linkedMapOf<Int, FileMapping>()
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@ class TryBlockCluster<T : IntervalWithHandler>(val blocks: MutableList<T>) {
|
||||
|
||||
|
||||
fun <T : IntervalWithHandler> doClustering(blocks: List<T>): List<TryBlockCluster<T>> {
|
||||
[data] class TryBlockInterval(val startLabel: LabelNode, val endLabel: LabelNode)
|
||||
@data class TryBlockInterval(val startLabel: LabelNode, val endLabel: LabelNode)
|
||||
|
||||
val clusters = linkedMapOf<TryBlockInterval, TryBlockCluster<T>>()
|
||||
blocks.forEach { block ->
|
||||
|
||||
@@ -35,7 +35,7 @@ import org.jetbrains.kotlin.compiler.plugin.*
|
||||
|
||||
public object PluginCliParser {
|
||||
|
||||
[platformStatic]
|
||||
@platformStatic
|
||||
fun loadPlugins(arguments: CommonCompilerArguments, configuration: CompilerConfiguration) {
|
||||
val classLoader = PluginURLClassLoader(
|
||||
arguments.pluginClasspaths
|
||||
|
||||
+4
-4
@@ -29,15 +29,15 @@ public open class JavaClassFinderPostConstruct {
|
||||
|
||||
public class JavaLazyAnalyzerPostConstruct : JavaClassFinderPostConstruct() {
|
||||
public var project: Project? = null
|
||||
[Inject] set
|
||||
@Inject set
|
||||
|
||||
public var trace: BindingTrace? = null
|
||||
[Inject] set
|
||||
@Inject set
|
||||
|
||||
public var codeAnalyzer: KotlinCodeAnalyzer? = null
|
||||
[Inject] set
|
||||
@Inject set
|
||||
|
||||
[PostConstruct] override fun postCreate() {
|
||||
@PostConstruct override fun postCreate() {
|
||||
CodeAnalyzerInitializer.getInstance(project!!).initialize(trace!!, codeAnalyzer!!.getModuleDescriptor(), codeAnalyzer)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -313,7 +313,7 @@ public class TypeResolver(
|
||||
}
|
||||
|
||||
companion object {
|
||||
[platformStatic]
|
||||
@platformStatic
|
||||
public fun resolveProjectionKind(projectionKind: JetProjectionKind): Variance {
|
||||
return when (projectionKind) {
|
||||
JetProjectionKind.IN -> IN_VARIANCE
|
||||
|
||||
@@ -94,7 +94,7 @@ public class CallCompleter(
|
||||
context: BasicCallResolutionContext,
|
||||
results: OverloadResolutionResultsImpl<D>
|
||||
) {
|
||||
[suppress("UNCHECKED_CAST")]
|
||||
@suppress("UNCHECKED_CAST")
|
||||
val candidates = (if (context.collectAllCandidates) {
|
||||
results.getAllCandidates()!!
|
||||
}
|
||||
@@ -274,7 +274,7 @@ public class CallCompleter(
|
||||
if (cachedDataForCall == null) return null
|
||||
|
||||
val (cachedResolutionResults, cachedContext, tracing) = cachedDataForCall
|
||||
[suppress("UNCHECKED_CAST")]
|
||||
@suppress("UNCHECKED_CAST")
|
||||
val cachedResults = cachedResolutionResults as OverloadResolutionResultsImpl<CallableDescriptor>
|
||||
val contextForArgument = cachedContext.replaceBindingTrace(context.trace)
|
||||
.replaceExpectedType(context.expectedType).replaceCollectAllCandidates(false)
|
||||
|
||||
@@ -82,7 +82,7 @@ public fun JetCallElement.getValueArgumentsInParentheses(): List<ValueArgument>
|
||||
|
||||
public fun Call.getValueArgumentListOrElement(): JetElement = getValueArgumentList() ?: getCalleeExpression() ?: getCallElement()
|
||||
|
||||
[suppress("UNCHECKED_CAST")]
|
||||
@suppress("UNCHECKED_CAST")
|
||||
private fun List<ValueArgument?>.filterArgsInParentheses() = filter { it !is JetFunctionLiteralArgument } as List<ValueArgument>
|
||||
|
||||
public fun Call.getValueArgumentForExpression(expression: JetExpression): ValueArgument? {
|
||||
|
||||
@@ -43,7 +43,7 @@ fun checkTraitRequirements(c: Map<JetClassOrObject, ClassDescriptorWithResolutio
|
||||
}
|
||||
|
||||
private fun getAllSuperTraits(descriptor: ClassDescriptor): List<ClassDescriptor> {
|
||||
[suppress("UNCHECKED_CAST")]
|
||||
@suppress("UNCHECKED_CAST")
|
||||
return TypeUtils.getAllSupertypes(descriptor.getDefaultType())
|
||||
.map { supertype -> supertype.getConstructor().getDeclarationDescriptor() }
|
||||
.filter { superClass -> DescriptorUtils.isTrait(superClass) } as List<ClassDescriptor>
|
||||
|
||||
+2
-2
@@ -638,7 +638,7 @@ private val BOOLEAN = CompileTimeType<Boolean>()
|
||||
private val STRING = CompileTimeType<String>()
|
||||
private val ANY = CompileTimeType<Any>()
|
||||
|
||||
[suppress("UNCHECKED_CAST")]
|
||||
@suppress("UNCHECKED_CAST")
|
||||
private fun <A, B> binaryOperation(
|
||||
a: CompileTimeType<A>,
|
||||
b: CompileTimeType<B>,
|
||||
@@ -647,7 +647,7 @@ private fun <A, B> binaryOperation(
|
||||
checker: Function2<BigInteger, BigInteger, BigInteger>
|
||||
) = BinaryOperationKey(a, b, functionName) to Pair(operation, checker) as Pair<Function2<Any?, Any?, Any>, Function2<BigInteger, BigInteger, BigInteger>>
|
||||
|
||||
[suppress("UNCHECKED_CAST")]
|
||||
@suppress("UNCHECKED_CAST")
|
||||
private fun <A> unaryOperation(
|
||||
a: CompileTimeType<A>,
|
||||
functionName: String,
|
||||
|
||||
+1
-1
@@ -115,7 +115,7 @@ public class LazyAnnotationDescriptor(
|
||||
|
||||
if (!resolutionResults.isSingleResult()) return mapOf()
|
||||
|
||||
[suppress("UNCHECKED_CAST")]
|
||||
@suppress("UNCHECKED_CAST")
|
||||
return resolutionResults.getResultingCall().getValueArguments()
|
||||
.mapValues { val (valueParameter, resolvedArgument) = it;
|
||||
if (resolvedArgument == null) null
|
||||
|
||||
+3
-3
@@ -101,7 +101,7 @@ public open class LazyClassMemberScope(
|
||||
OverridingUtil.generateOverridesInFunctionGroup(name, fromSupertypes, ArrayList(result), thisDescriptor, object : OverridingUtil.DescriptorSink {
|
||||
override fun addToScope(fakeOverride: CallableMemberDescriptor) {
|
||||
assert(exactDescriptorClass.isInstance(fakeOverride)) { "Wrong descriptor type in an override: " + fakeOverride + " while expecting " + exactDescriptorClass.getSimpleName() }
|
||||
[suppress("UNCHECKED_CAST")]
|
||||
@suppress("UNCHECKED_CAST")
|
||||
result.add(fakeOverride as D)
|
||||
}
|
||||
|
||||
@@ -188,7 +188,7 @@ public open class LazyClassMemberScope(
|
||||
}
|
||||
}
|
||||
|
||||
[suppress("UNCHECKED_CAST")]
|
||||
@suppress("UNCHECKED_CAST")
|
||||
protected override fun getNonDeclaredProperties(name: Name, result: MutableSet<VariableDescriptor>) {
|
||||
createPropertiesFromPrimaryConstructorParameters(name, result)
|
||||
|
||||
@@ -319,7 +319,7 @@ public open class LazyClassMemberScope(
|
||||
|
||||
private val EXTRACT_PROPERTIES: MemberExtractor<PropertyDescriptor> = object : MemberExtractor<PropertyDescriptor> {
|
||||
override fun extract(extractFrom: JetType, name: Name): Collection<PropertyDescriptor> {
|
||||
[suppress("UNCHECKED_CAST")]
|
||||
@suppress("UNCHECKED_CAST")
|
||||
return extractFrom.getMemberScope().getProperties(name) as Collection<PropertyDescriptor>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -203,7 +203,7 @@ class LazyOperationsLog(
|
||||
private fun <T> Any.field(name: String): T {
|
||||
val field = this.javaClass.getDeclaredField(name)
|
||||
field.setAccessible(true)
|
||||
[suppress("UNCHECKED_CAST")]
|
||||
@suppress("UNCHECKED_CAST")
|
||||
return field.get(this) as T
|
||||
}
|
||||
|
||||
|
||||
@@ -121,7 +121,7 @@ public class LoggingStorageManager(
|
||||
var c = this
|
||||
while (true) {
|
||||
result.addAll(c.getDeclaredFields().toList())
|
||||
[suppress("UNCHECKED_CAST")]
|
||||
@suppress("UNCHECKED_CAST")
|
||||
val superClass = (c as Class<Any>).getSuperclass() as Class<Any>?
|
||||
if (superClass == null) break
|
||||
if (c == superClass) break
|
||||
|
||||
@@ -74,7 +74,7 @@ public abstract class AbstractLocalClassProtoTest : TestCaseWithTmpdir() {
|
||||
}
|
||||
|
||||
private fun assertHasAnnotationData(clazz: Class<*>) {
|
||||
[suppress("UNCHECKED_CAST")]
|
||||
@suppress("UNCHECKED_CAST")
|
||||
val annotation = clazz.getAnnotation(
|
||||
clazz.getClassLoader().loadClass(JvmAnnotationNames.KOTLIN_CLASS.asString()) as Class<Annotation>
|
||||
)
|
||||
|
||||
@@ -24,7 +24,7 @@ public class Services private(private val map: Map<Class<*>, Any>) {
|
||||
}
|
||||
|
||||
public fun <T> get(interfaceClass: Class<T>): T {
|
||||
[suppress("UNCHECKED_CAST")]
|
||||
@suppress("UNCHECKED_CAST")
|
||||
return map.get(interfaceClass) as T
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ public class LockedClearableLazyValue<T: Any>(val lock: Any, val init: () -> T)
|
||||
return synchronized(lock) {
|
||||
val _v2 = value
|
||||
// Suppress because of https://youtrack.jetbrains.com/issue/KT-6176
|
||||
[suppress("UNNECESSARY_NOT_NULL_ASSERTION")]
|
||||
@suppress("UNNECESSARY_NOT_NULL_ASSERTION")
|
||||
if (_v2 != null) {
|
||||
_v2!!
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user