Deprecate deprecated in favor of Deprecated
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
fun foo1() {}
|
||||
deprecated("Use foo3 instead") fun foo2() {}
|
||||
Deprecated("Use foo3 instead") fun foo2() {}
|
||||
fun foo3() {}
|
||||
|
||||
fun test() {
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
class MyClassA
|
||||
deprecated class MyClassB
|
||||
Deprecated class MyClassB
|
||||
class MyClassC
|
||||
|
||||
fun foo(myCla<caret>)
|
||||
|
||||
+4
-2
@@ -20,6 +20,7 @@ import com.intellij.openapi.editor.Editor
|
||||
import com.intellij.openapi.util.TextRange
|
||||
import com.intellij.psi.PsiDocumentManager
|
||||
import com.intellij.psi.codeStyle.CodeStyleManager
|
||||
import org.jetbrains.kotlin.builtins.KotlinBuiltIns
|
||||
import org.jetbrains.kotlin.descriptors.DeclarationDescriptorWithVisibility
|
||||
import org.jetbrains.kotlin.descriptors.FunctionDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.PackageFragmentDescriptor
|
||||
@@ -44,7 +45,7 @@ import java.util.ArrayList
|
||||
public class DeprecatedCallableAddReplaceWithInspection : IntentionBasedInspection<JetCallableDeclaration>(DeprecatedCallableAddReplaceWithIntention())
|
||||
|
||||
public class DeprecatedCallableAddReplaceWithIntention : JetSelfTargetingRangeIntention<JetCallableDeclaration>(
|
||||
javaClass(), "Add 'replaceWith' argument to specify replacement pattern", "Add 'replaceWith' argument to 'deprecated' annotation"
|
||||
javaClass(), "Add 'replaceWith' argument to specify replacement pattern", "Add 'replaceWith' argument to 'Deprecated' annotation"
|
||||
) {
|
||||
private class ReplaceWith(val expression: String, vararg val imports: String)
|
||||
|
||||
@@ -112,7 +113,8 @@ public class DeprecatedCallableAddReplaceWithIntention : JetSelfTargetingRangeIn
|
||||
|
||||
//TODO
|
||||
val descriptor = resolvedCall.getResultingDescriptor().getContainingDeclaration()
|
||||
if (DescriptorUtils.getFqName(descriptor).asString() != "kotlin.deprecated") continue
|
||||
val descriptorFqName = DescriptorUtils.getFqName(descriptor).toSafe()
|
||||
if (descriptorFqName != KotlinBuiltIns.FQ_NAMES.deprecated) continue
|
||||
|
||||
val replaceWithArguments = resolvedCall.getValueArguments().entrySet()
|
||||
.single { it.key.getName().asString() == "replaceWith"/*TODO: kotlin.deprecated::replaceWith.name*/ }.value
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
<error>@file:kotlin.deprecated("message")</error>
|
||||
<error>@file:kotlin.Deprecated("message")</error>
|
||||
@file:Suppress(<error>BAR</error>)
|
||||
<error>@file:Suppress(BAZ)</error>
|
||||
|
||||
<error><error>@<error>k</error>otlin.deprecated("message")</error></error>
|
||||
<error><error>@<error>k</error>otlin.Deprecated("message")</error></error>
|
||||
<error>@<error>S</error>uppress(<error>BAR</error>)</error>
|
||||
<error>@<error>S</error>uppress(BAZ)</error>
|
||||
|
||||
|
||||
@@ -6,5 +6,5 @@ package test
|
||||
kotlin.data dependency.A dependency.B dependency.C internal final class Annotations public constructor() {
|
||||
kotlin.inline dependency.A dependency.B dependency.C internal final val p: @[dependency.B] kotlin.Int /* compiled code */
|
||||
|
||||
kotlin.inline dependency.A dependency.B dependency.C internal final fun f(dependency.A dependency.B dependency.C kotlin.deprecated i: @[dependency.A] kotlin.Int): kotlin.Unit { /* compiled code */ }
|
||||
kotlin.inline dependency.A dependency.B dependency.C internal final fun f(dependency.A dependency.B dependency.C kotlin.Deprecated i: @[dependency.A] kotlin.Int): kotlin.Unit { /* compiled code */ }
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import dependency.*
|
||||
|
||||
data A("a") B(1) C class Annotations {
|
||||
|
||||
inline A("f") B(2) C fun f(A("i") B(3) C deprecated("1") i: @A("int") Int) {
|
||||
inline A("f") B(2) C fun f(A("i") B(3) C Deprecated("1") i: @A("int") Int) {
|
||||
}
|
||||
|
||||
inline A("p") B(3) C val p: @B(4) Int = 2
|
||||
|
||||
+2
-2
@@ -5,8 +5,8 @@ class <info textAttributesKey="KOTLIN_CLASS">TheClass</info> : <info textAttribu
|
||||
}
|
||||
|
||||
<info textAttributesKey="KOTLIN_ANNOTATION">annotation</info> class <info textAttributesKey="KOTLIN_ANNOTATION">magnificent</info>
|
||||
<info textAttributesKey="KOTLIN_ANNOTATION">annotation</info> class <info textAttributesKey="KOTLIN_ANNOTATION">deprecated</info>
|
||||
<info textAttributesKey="KOTLIN_ANNOTATION">annotation</info> class <info textAttributesKey="KOTLIN_ANNOTATION">Deprecated</info>
|
||||
|
||||
<info textAttributesKey="KOTLIN_ANNOTATION">@deprecated</info>
|
||||
<info textAttributesKey="KOTLIN_ANNOTATION">@Deprecated</info>
|
||||
<info textAttributesKey="KOTLIN_ANNOTATION">magnificent</info> <info textAttributesKey="KOTLIN_BUILTIN_ANNOTATION">abstract</info> class <info textAttributesKey="KOTLIN_ABSTRACT_CLASS">AbstractClass</info><<info textAttributesKey="KOTLIN_TYPE_PARAMETER">T</info>> {
|
||||
}
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ package test
|
||||
|
||||
import java.util.ArrayList
|
||||
|
||||
deprecated("Use A instead") open class MyClass {}
|
||||
Deprecated("Use A instead") open class MyClass {}
|
||||
|
||||
fun test() {
|
||||
val a : <warning descr="[DEPRECATED_SYMBOL_WITH_MESSAGE] 'MyClass' is deprecated. Use A instead">MyClass</warning>? = null
|
||||
|
||||
+2
-2
@@ -13,13 +13,13 @@ fun test() {
|
||||
}
|
||||
|
||||
class MyClass(): MyTrait {
|
||||
deprecated("Use A instead") companion object {
|
||||
Deprecated("Use A instead") companion object {
|
||||
val test: String = ""
|
||||
}
|
||||
}
|
||||
|
||||
interface MyTrait {
|
||||
deprecated("Use A instead") companion object {
|
||||
Deprecated("Use A instead") companion object {
|
||||
val test: String = ""
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
deprecated("does nothing good")
|
||||
Deprecated("does nothing good")
|
||||
fun Any.doNothing() = this.toString() // "this" should not be marked as deprecated despite it referes to deprecated function
|
||||
|
||||
// NO_CHECK_INFOS
|
||||
|
||||
+4
-4
@@ -6,14 +6,14 @@ fun test() {
|
||||
<warning descr="[DEPRECATED_SYMBOL_WITH_MESSAGE] 'test4(Int, Int): Unit' is deprecated. Use A instead">test4</warning>(1, 2)
|
||||
}
|
||||
|
||||
deprecated("Use A instead") fun test1() { }
|
||||
deprecated("Use A instead") fun test4(x: Int, y: Int) { x + y }
|
||||
Deprecated("Use A instead") fun test1() { }
|
||||
Deprecated("Use A instead") fun test4(x: Int, y: Int) { x + y }
|
||||
|
||||
class MyClass() {
|
||||
deprecated("Use A instead") fun test2() {}
|
||||
Deprecated("Use A instead") fun test2() {}
|
||||
|
||||
companion object {
|
||||
deprecated("Use A instead") fun test3() {}
|
||||
Deprecated("Use A instead") fun test3() {}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
class MyClass {}
|
||||
|
||||
deprecated("Use A instead") fun MyClass.get(i: MyClass): MyClass { return i }
|
||||
Deprecated("Use A instead") fun MyClass.get(i: MyClass): MyClass { return i }
|
||||
|
||||
fun test() {
|
||||
val x1 = MyClass()
|
||||
|
||||
+4
-4
@@ -9,13 +9,13 @@ fun test() {
|
||||
|
||||
class MyClass() {
|
||||
public val test1: String = ""
|
||||
@deprecated("Use A instead") get
|
||||
@Deprecated("Use A instead") get
|
||||
|
||||
public var test2: String = ""
|
||||
@deprecated("Use A instead") get
|
||||
@Deprecated("Use A instead") get
|
||||
|
||||
deprecated("Use A instead") public val test3: String = ""
|
||||
@deprecated("Use A instead") get
|
||||
Deprecated("Use A instead") public val test3: String = ""
|
||||
@Deprecated("Use A instead") get
|
||||
}
|
||||
|
||||
// NO_CHECK_INFOS
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ class MyClass {
|
||||
val i = 0
|
||||
}
|
||||
|
||||
deprecated("Use A instead") fun MyClass.inc(): MyClass { return MyClass() }
|
||||
Deprecated("Use A instead") fun MyClass.inc(): MyClass { return MyClass() }
|
||||
|
||||
fun test() {
|
||||
var x3 = MyClass()
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
deprecated(<error>)</error>
|
||||
Deprecated(<error>)</error>
|
||||
fun foo() {}
|
||||
deprecated(<error>false</error>)
|
||||
Deprecated(<error>false</error>)
|
||||
fun boo() {}
|
||||
|
||||
fun far() = <warning descr="[DEPRECATED_SYMBOL] 'foo(): Unit' is deprecated.">foo</warning>()
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
class MyRunnable() {}
|
||||
|
||||
deprecated("Use A instead") fun MyRunnable.invoke() {
|
||||
Deprecated("Use A instead") fun MyRunnable.invoke() {
|
||||
}
|
||||
|
||||
fun test() {
|
||||
|
||||
+8
-8
@@ -2,18 +2,18 @@ class MyClass {
|
||||
val i = 0
|
||||
}
|
||||
|
||||
deprecated("Use A instead") fun MyClass.minus(i: MyClass) { i.i }
|
||||
deprecated("Use A instead") fun MyClass.div(i: MyClass) { i.i }
|
||||
deprecated("Use A instead") fun MyClass.times(i: MyClass) { i.i }
|
||||
Deprecated("Use A instead") fun MyClass.minus(i: MyClass) { i.i }
|
||||
Deprecated("Use A instead") fun MyClass.div(i: MyClass) { i.i }
|
||||
Deprecated("Use A instead") fun MyClass.times(i: MyClass) { i.i }
|
||||
|
||||
deprecated("Use A instead") fun MyClass.not() { }
|
||||
deprecated("Use A instead") fun MyClass.plus() { }
|
||||
Deprecated("Use A instead") fun MyClass.not() { }
|
||||
Deprecated("Use A instead") fun MyClass.plus() { }
|
||||
|
||||
deprecated("Use A instead") fun MyClass.contains(i: MyClass): Boolean { i.i; return false }
|
||||
Deprecated("Use A instead") fun MyClass.contains(i: MyClass): Boolean { i.i; return false }
|
||||
|
||||
deprecated("Use A instead") fun MyClass.plusAssign(i: MyClass) { i.i }
|
||||
Deprecated("Use A instead") fun MyClass.plusAssign(i: MyClass) { i.i }
|
||||
|
||||
deprecated("Use A instead") fun MyClass.rangeTo(i: MyClass): IntRange { return IntRange(i.i, i.i) }
|
||||
Deprecated("Use A instead") fun MyClass.rangeTo(i: MyClass): IntRange { return IntRange(i.i, i.i) }
|
||||
|
||||
fun test() {
|
||||
val x1 = MyClass()
|
||||
|
||||
+6
-6
@@ -8,16 +8,16 @@ fun test() {
|
||||
MyClass.<warning descr="[DEPRECATED_SYMBOL_WITH_MESSAGE] 'test6: String' is deprecated. Use A instead">test6</warning>
|
||||
}
|
||||
|
||||
deprecated("Use A instead") val test1: String = ""
|
||||
deprecated("Use A instead") var test4: String = ""
|
||||
Deprecated("Use A instead") val test1: String = ""
|
||||
Deprecated("Use A instead") var test4: String = ""
|
||||
|
||||
class MyClass() {
|
||||
deprecated("Use A instead") val test2: String = ""
|
||||
deprecated("Use A instead") var test5: String = ""
|
||||
Deprecated("Use A instead") val test2: String = ""
|
||||
Deprecated("Use A instead") var test5: String = ""
|
||||
|
||||
companion object {
|
||||
deprecated("Use A instead") val test3: String = ""
|
||||
deprecated("Use A instead") var test6: String = ""
|
||||
Deprecated("Use A instead") val test3: String = ""
|
||||
Deprecated("Use A instead") var test6: String = ""
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ class MyClass {
|
||||
val i = 1
|
||||
}
|
||||
|
||||
deprecated("Use A instead") fun MyClass.rangeTo(i: MyClass): Iterable<Int> {
|
||||
Deprecated("Use A instead") fun MyClass.rangeTo(i: MyClass): Iterable<Int> {
|
||||
i.i
|
||||
throw Exception()
|
||||
}
|
||||
|
||||
+2
-2
@@ -19,11 +19,11 @@ fun test() {
|
||||
|
||||
class MyClass() {
|
||||
public var test1: Int = 0
|
||||
@deprecated("Use A instead") set
|
||||
@Deprecated("Use A instead") set
|
||||
}
|
||||
|
||||
public var test2: Int = 0
|
||||
@deprecated("Use A instead") set
|
||||
@Deprecated("Use A instead") set
|
||||
|
||||
// NO_CHECK_INFOS
|
||||
// NO_CHECK_WEAK_WARNINGS
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
deprecated("Use A instead") interface MyTrait { }
|
||||
Deprecated("Use A instead") interface MyTrait { }
|
||||
|
||||
fun test() {
|
||||
val a: <warning descr="[DEPRECATED_SYMBOL_WITH_MESSAGE] 'MyTrait' is deprecated. Use A instead">MyTrait</warning>? = null
|
||||
|
||||
+4
-4
@@ -1,17 +1,17 @@
|
||||
package pack
|
||||
|
||||
@deprecated("", ReplaceWith("bar(p + 1)"))
|
||||
@Deprecated("", ReplaceWith("bar(p + 1)"))
|
||||
public fun oldFun1(p: Int): Int = 0
|
||||
|
||||
@deprecated("", ReplaceWith("bar(-1)"))
|
||||
@Deprecated("", ReplaceWith("bar(-1)"))
|
||||
public fun oldFun1(): Int = 0
|
||||
|
||||
@deprecated("", ReplaceWith("bar(p + 2)"))
|
||||
@Deprecated("", ReplaceWith("bar(p + 2)"))
|
||||
public fun oldFun2(p: Int): Int = 0
|
||||
|
||||
public fun oldFun2(): Int = 0
|
||||
|
||||
@deprecated("", ReplaceWith("bar(p)"))
|
||||
@Deprecated("", ReplaceWith("bar(p)"))
|
||||
public fun oldFun3(p: Int): Int = 0
|
||||
|
||||
public fun bar(p: Int): Int = p
|
||||
@@ -1,2 +1,2 @@
|
||||
@deprecated("a")
|
||||
@Deprecated("a")
|
||||
<caret>class C
|
||||
@@ -1,2 +1,2 @@
|
||||
@deprecated("a")
|
||||
@Deprecated("a")
|
||||
private<caret> class C
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
// IS_APPLICABLE: false
|
||||
<caret>@deprecated("", ReplaceWith("bar()"))
|
||||
<caret>@Deprecated("", ReplaceWith("bar()"))
|
||||
fun foo() {
|
||||
bar()
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<caret>@deprecated("")
|
||||
<caret>@Deprecated("")
|
||||
fun foo() {
|
||||
// invoke bar()
|
||||
bar()
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
@deprecated("", <caret>ReplaceWith("bar()"))
|
||||
@Deprecated("", <caret>ReplaceWith("bar()"))
|
||||
fun foo() {
|
||||
// invoke bar()
|
||||
bar()
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
// IS_APPLICABLE: false
|
||||
<caret>@deprecated("")
|
||||
<caret>@Deprecated("")
|
||||
fun foo(p: Int) {
|
||||
if (p > 0) {
|
||||
val v = p + 1
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
<caret>@deprecated("")
|
||||
<caret>@Deprecated("")
|
||||
fun foo(): String = bar()
|
||||
|
||||
fun bar(): String = ""
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
@deprecated("", <caret>ReplaceWith("bar()"))
|
||||
@Deprecated("", <caret>ReplaceWith("bar()"))
|
||||
fun foo(): String = bar()
|
||||
|
||||
fun bar(): String = ""
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<caret>@deprecated("")
|
||||
<caret>@Deprecated("")
|
||||
fun foo(p: Int) {
|
||||
if (p > 0)
|
||||
bar1(p)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@deprecated("", ReplaceWith("if (p > 0) bar1(p) else bar2(p)"))
|
||||
@Deprecated("", ReplaceWith("if (p > 0) bar1(p) else bar2(p)"))
|
||||
fun foo(p: Int) {
|
||||
if (p > 0)
|
||||
bar1(p)
|
||||
|
||||
@@ -2,7 +2,7 @@ package pack
|
||||
|
||||
import dependency.valueFromOtherPackage
|
||||
|
||||
<caret>@deprecated("")
|
||||
<caret>@Deprecated("")
|
||||
fun foo() {
|
||||
bar(valueFromOtherPackage)
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ package pack
|
||||
|
||||
import dependency.valueFromOtherPackage
|
||||
|
||||
@deprecated("", ReplaceWith("bar(valueFromOtherPackage)", "dependency.valueFromOtherPackage"))
|
||||
@Deprecated("", ReplaceWith("bar(valueFromOtherPackage)", "dependency.valueFromOtherPackage"))
|
||||
fun foo() {
|
||||
bar(valueFromOtherPackage)
|
||||
}
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ package pack
|
||||
|
||||
import dependency.D
|
||||
|
||||
<caret>@deprecated("")
|
||||
<caret>@Deprecated("")
|
||||
fun foo() {
|
||||
bar(D.value)
|
||||
}
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ package pack
|
||||
|
||||
import dependency.D
|
||||
|
||||
@deprecated("", ReplaceWith("bar(D.value)", "dependency.D"))
|
||||
@Deprecated("", ReplaceWith("bar(D.value)", "dependency.D"))
|
||||
fun foo() {
|
||||
bar(D.value)
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
<caret>@deprecated("")
|
||||
<caret>@Deprecated("")
|
||||
fun foo(s: String): String {
|
||||
return s.substring(1) + Int.MAX_VALUE
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
@deprecated("", ReplaceWith("s.substring(1) + Int.MAX_VALUE"))
|
||||
@Deprecated("", ReplaceWith("s.substring(1) + Int.MAX_VALUE"))
|
||||
fun foo(s: String): String {
|
||||
return s.substring(1) + Int.MAX_VALUE
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// IS_APPLICABLE: false
|
||||
// ERROR: A 'return' expression required in a function with a block body ('{...}')
|
||||
|
||||
<caret>@deprecated("")
|
||||
<caret>@Deprecated("")
|
||||
fun foo(): String {
|
||||
bar()
|
||||
}
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
/**
|
||||
* <caret>This is a doc-comment
|
||||
*/
|
||||
@deprecated("")
|
||||
@Deprecated("")
|
||||
fun foo() {
|
||||
bar()
|
||||
}
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
class C {
|
||||
private val v = 1
|
||||
|
||||
<caret>@deprecated("")
|
||||
<caret>@Deprecated("")
|
||||
fun foo() {
|
||||
bar(v)
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<caret>@deprecated("")
|
||||
<caret>@Deprecated("")
|
||||
fun foo(s: String) {
|
||||
s.bar()
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
@deprecated("", <caret>ReplaceWith("s.bar()"))
|
||||
@Deprecated("", <caret>ReplaceWith("s.bar()"))
|
||||
fun foo(s: String) {
|
||||
s.bar()
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<caret>@deprecated("")
|
||||
<caret>@Deprecated("")
|
||||
fun foo(): String {
|
||||
return bar()
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@deprecated("", <caret>ReplaceWith("bar()"))
|
||||
@Deprecated("", <caret>ReplaceWith("bar()"))
|
||||
fun foo(): String {
|
||||
return bar()
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// IS_APPLICABLE: false
|
||||
<caret>@deprecated("")
|
||||
<caret>@Deprecated("")
|
||||
fun foo() {
|
||||
bar() ?: return
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<caret>@deprecated("")
|
||||
<caret>@Deprecated("")
|
||||
fun foo() {
|
||||
bar()
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@deprecated("", <caret>ReplaceWith("bar()"))
|
||||
@Deprecated("", <caret>ReplaceWith("bar()"))
|
||||
fun foo() {
|
||||
bar()
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<caret>@deprecated("")
|
||||
<caret>@Deprecated("")
|
||||
fun foo(p: Int) {
|
||||
bar("\"\"\n1\r2\t3")
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
@deprecated("", ReplaceWith("bar(\"\\\"\\\"\\n1\\r2\\t3\")"))
|
||||
@Deprecated("", ReplaceWith("bar(\"\\\"\\\"\\n1\\r2\\t3\")"))
|
||||
fun foo(p: Int) {
|
||||
bar("\"\"\n1\r2\t3")
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
<caret>@deprecated("")
|
||||
<caret>@Deprecated("")
|
||||
fun foo(p: Int) {
|
||||
bar("$p ${p + 1} $0")
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
@deprecated("", ReplaceWith("bar(\"\$p \${p + 1} $0\")"))
|
||||
@Deprecated("", ReplaceWith("bar(\"\$p \${p + 1} $0\")"))
|
||||
fun foo(p: Int) {
|
||||
bar("$p ${p + 1} $0")
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// IS_APPLICABLE: false
|
||||
<caret>@deprecated("")
|
||||
<caret>@Deprecated("")
|
||||
fun foo() {
|
||||
bar()
|
||||
bar()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class C {
|
||||
<caret>@deprecated("")
|
||||
<caret>@Deprecated("")
|
||||
val foo: String
|
||||
get() = bar()
|
||||
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
class C {
|
||||
@deprecated("", ReplaceWith("bar()"))
|
||||
@Deprecated("", ReplaceWith("bar()"))
|
||||
val foo: String
|
||||
get() = bar()
|
||||
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
class C {
|
||||
<caret>@deprecated("")
|
||||
<caret>@Deprecated("")
|
||||
val foo: String
|
||||
get() {
|
||||
return bar()
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
class C {
|
||||
@deprecated("", ReplaceWith("bar()"))
|
||||
@Deprecated("", ReplaceWith("bar()"))
|
||||
val foo: String
|
||||
get() {
|
||||
return bar()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
deprecated("") fun f(x: Int) = 2
|
||||
Deprecated("") fun f(x: Int) = 2
|
||||
fun f(x: Int, y: Boolean) = 3
|
||||
|
||||
fun d(x: Int) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// "Replace with 'newFun1(newFun2())'" "true"
|
||||
|
||||
class X {
|
||||
@deprecated("", ReplaceWith("newFun1(newFun2())"))
|
||||
@Deprecated("", ReplaceWith("newFun1(newFun2())"))
|
||||
fun oldFun() {
|
||||
newFun1(newFun2())
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
// "Replace with 'newFun1(newFun2())'" "true"
|
||||
|
||||
class X {
|
||||
@deprecated("", ReplaceWith("newFun1(newFun2())"))
|
||||
@Deprecated("", ReplaceWith("newFun1(newFun2())"))
|
||||
fun oldFun() {
|
||||
newFun1(newFun2())
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -1,6 +1,6 @@
|
||||
// "Replace with 'newFun()'" "true"
|
||||
|
||||
@deprecated("", ReplaceWith("newFun()"))
|
||||
@Deprecated("", ReplaceWith("newFun()"))
|
||||
fun oldFun(p: Int) {
|
||||
newFun()
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -1,6 +1,6 @@
|
||||
// "Replace with 'newFun()'" "true"
|
||||
|
||||
@deprecated("", ReplaceWith("newFun()"))
|
||||
@Deprecated("", ReplaceWith("newFun()"))
|
||||
fun oldFun(p: Int) {
|
||||
newFun()
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -1,7 +1,7 @@
|
||||
// "Replace with 'newFun()'" "true"
|
||||
|
||||
class C {
|
||||
@deprecated("", ReplaceWith("newFun()"))
|
||||
@Deprecated("", ReplaceWith("newFun()"))
|
||||
fun oldFun() {
|
||||
newFun()
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -1,7 +1,7 @@
|
||||
// "Replace with 'newFun()'" "true"
|
||||
|
||||
class C {
|
||||
@deprecated("", ReplaceWith("newFun()"))
|
||||
@Deprecated("", ReplaceWith("newFun()"))
|
||||
fun oldFun() {
|
||||
newFun()
|
||||
}
|
||||
|
||||
idea/testData/quickfix/deprecatedSymbolUsage/argumentSideEffects/complexExpressionNotUsed3Runtime.kt
Vendored
+1
-1
@@ -1,6 +1,6 @@
|
||||
// "Replace with 'newFun()'" "true"
|
||||
|
||||
@deprecated("", ReplaceWith("newFun()"))
|
||||
@Deprecated("", ReplaceWith("newFun()"))
|
||||
fun oldFun(p: Int): Int {
|
||||
return newFun()
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
// "Replace with 'newFun()'" "true"
|
||||
|
||||
@deprecated("", ReplaceWith("newFun()"))
|
||||
@Deprecated("", ReplaceWith("newFun()"))
|
||||
fun oldFun(p: Int): Int {
|
||||
return newFun()
|
||||
}
|
||||
|
||||
idea/testData/quickfix/deprecatedSymbolUsage/argumentSideEffects/complexExpressionNotUsed4Runtime.kt
Vendored
+1
-1
@@ -1,6 +1,6 @@
|
||||
// "Replace with 'newFun()'" "true"
|
||||
|
||||
@deprecated("", ReplaceWith("newFun()"))
|
||||
@Deprecated("", ReplaceWith("newFun()"))
|
||||
fun oldFun(p: Int?): Int {
|
||||
return newFun()
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
// "Replace with 'newFun()'" "true"
|
||||
|
||||
@deprecated("", ReplaceWith("newFun()"))
|
||||
@Deprecated("", ReplaceWith("newFun()"))
|
||||
fun oldFun(p: Int?): Int {
|
||||
return newFun()
|
||||
}
|
||||
|
||||
idea/testData/quickfix/deprecatedSymbolUsage/argumentSideEffects/complexExpressionNotUsed5Runtime.kt
Vendored
+1
-1
@@ -1,6 +1,6 @@
|
||||
// "Replace with 'newFun(p2)'" "true"
|
||||
|
||||
@deprecated("", ReplaceWith("newFun(p2)"))
|
||||
@Deprecated("", ReplaceWith("newFun(p2)"))
|
||||
fun oldFun(p1: Int, p2: Int): Boolean {
|
||||
return newFun(p2)
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
// "Replace with 'newFun(p2)'" "true"
|
||||
|
||||
@deprecated("", ReplaceWith("newFun(p2)"))
|
||||
@Deprecated("", ReplaceWith("newFun(p2)"))
|
||||
fun oldFun(p1: Int, p2: Int): Boolean {
|
||||
return newFun(p2)
|
||||
}
|
||||
|
||||
idea/testData/quickfix/deprecatedSymbolUsage/argumentSideEffects/complexExpressionNotUsedSafeCall.kt
Vendored
+1
-1
@@ -1,7 +1,7 @@
|
||||
// "Replace with 'newFun()'" "true"
|
||||
|
||||
class C {
|
||||
@deprecated("", ReplaceWith("newFun()"))
|
||||
@Deprecated("", ReplaceWith("newFun()"))
|
||||
fun oldFun() {
|
||||
newFun()
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
// "Replace with 'newFun()'" "true"
|
||||
|
||||
class C {
|
||||
@deprecated("", ReplaceWith("newFun()"))
|
||||
@Deprecated("", ReplaceWith("newFun()"))
|
||||
fun oldFun() {
|
||||
newFun()
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
// "Replace with 'newFun()'" "true"
|
||||
|
||||
class C {
|
||||
@deprecated("", ReplaceWith("newFun()"))
|
||||
@Deprecated("", ReplaceWith("newFun()"))
|
||||
fun oldFun(): Int {
|
||||
return newFun()
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
// "Replace with 'newFun()'" "true"
|
||||
|
||||
class C {
|
||||
@deprecated("", ReplaceWith("newFun()"))
|
||||
@Deprecated("", ReplaceWith("newFun()"))
|
||||
fun oldFun(): Int {
|
||||
return newFun()
|
||||
}
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ package ppp
|
||||
|
||||
fun bar(): Int = 0
|
||||
|
||||
@deprecated("", ReplaceWith("newFun()"))
|
||||
@Deprecated("", ReplaceWith("newFun()"))
|
||||
fun oldFun(p: Int = ppp.bar()) {
|
||||
newFun()
|
||||
}
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ package ppp
|
||||
|
||||
fun bar(): Int = 0
|
||||
|
||||
@deprecated("", ReplaceWith("newFun()"))
|
||||
@Deprecated("", ReplaceWith("newFun()"))
|
||||
fun oldFun(p: Int = ppp.bar()) {
|
||||
newFun()
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -1,6 +1,6 @@
|
||||
// "Replace with 'newFun(p, p)'" "true"
|
||||
|
||||
@deprecated("", ReplaceWith("newFun(p, p)"))
|
||||
@Deprecated("", ReplaceWith("newFun(p, p)"))
|
||||
fun oldFun(p: Int) {
|
||||
newFun(p, p)
|
||||
}
|
||||
|
||||
idea/testData/quickfix/deprecatedSymbolUsage/argumentSideEffects/complexExpressionUsedTwice.kt.after
Vendored
+1
-1
@@ -1,6 +1,6 @@
|
||||
// "Replace with 'newFun(p, p)'" "true"
|
||||
|
||||
@deprecated("", ReplaceWith("newFun(p, p)"))
|
||||
@Deprecated("", ReplaceWith("newFun(p, p)"))
|
||||
fun oldFun(p: Int) {
|
||||
newFun(p, p)
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -1,7 +1,7 @@
|
||||
// "Replace with 'newFun(this)'" "true"
|
||||
|
||||
class C {
|
||||
@deprecated("", ReplaceWith("newFun(this)"))
|
||||
@Deprecated("", ReplaceWith("newFun(this)"))
|
||||
fun oldFun(){}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
// "Replace with 'newFun(this)'" "true"
|
||||
|
||||
class C {
|
||||
@deprecated("", ReplaceWith("newFun(this)"))
|
||||
@Deprecated("", ReplaceWith("newFun(this)"))
|
||||
fun oldFun(){}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
// "Replace with 'newFun(p, p)'" "true"
|
||||
|
||||
@deprecated("", ReplaceWith("newFun(p, p)"))
|
||||
@Deprecated("", ReplaceWith("newFun(p, p)"))
|
||||
fun oldFun(p: Int): Int {
|
||||
return newFun(p, p)
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
// "Replace with 'newFun(p, p)'" "true"
|
||||
|
||||
@deprecated("", ReplaceWith("newFun(p, p)"))
|
||||
@Deprecated("", ReplaceWith("newFun(p, p)"))
|
||||
fun oldFun(p: Int): Int {
|
||||
return newFun(p, p)
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -1,7 +1,7 @@
|
||||
// "Replace with 'newFun(this, p)'" "true"
|
||||
|
||||
class C {
|
||||
@deprecated("", ReplaceWith("newFun(this, p)"))
|
||||
@Deprecated("", ReplaceWith("newFun(this, p)"))
|
||||
fun oldFun(p: Int){}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
// "Replace with 'newFun(this, p)'" "true"
|
||||
|
||||
class C {
|
||||
@deprecated("", ReplaceWith("newFun(this, p)"))
|
||||
@Deprecated("", ReplaceWith("newFun(this, p)"))
|
||||
fun oldFun(p: Int){}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
import java.util.*
|
||||
|
||||
@deprecated("", ReplaceWith("newFun(p, p)"))
|
||||
@Deprecated("", ReplaceWith("newFun(p, p)"))
|
||||
fun oldFun(p: List<String>) {
|
||||
newFun(p, p)
|
||||
}
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
import java.util.*
|
||||
|
||||
@deprecated("", ReplaceWith("newFun(p, p)"))
|
||||
@Deprecated("", ReplaceWith("newFun(p, p)"))
|
||||
fun oldFun(p: List<String>) {
|
||||
newFun(p, p)
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
// "Replace with 'newFun(p, p)'" "true"
|
||||
|
||||
@deprecated("", ReplaceWith("newFun(p, p)"))
|
||||
@Deprecated("", ReplaceWith("newFun(p, p)"))
|
||||
fun oldFun(p: Int?): Int {
|
||||
return newFun(p, p)
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
// "Replace with 'newFun(p, p)'" "true"
|
||||
|
||||
@deprecated("", ReplaceWith("newFun(p, p)"))
|
||||
@Deprecated("", ReplaceWith("newFun(p, p)"))
|
||||
fun oldFun(p: Int?): Int {
|
||||
return newFun(p, p)
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -1,6 +1,6 @@
|
||||
// "Replace with 'newFun()'" "true"
|
||||
|
||||
@deprecated("", ReplaceWith("newFun()"))
|
||||
@Deprecated("", ReplaceWith("newFun()"))
|
||||
fun oldFun(p: Int) {
|
||||
newFun()
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -1,6 +1,6 @@
|
||||
// "Replace with 'newFun()'" "true"
|
||||
|
||||
@deprecated("", ReplaceWith("newFun()"))
|
||||
@Deprecated("", ReplaceWith("newFun()"))
|
||||
fun oldFun(p: Int) {
|
||||
newFun()
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -1,6 +1,6 @@
|
||||
// "Replace with 'newFun(p, p)'" "true"
|
||||
|
||||
@deprecated("", ReplaceWith("newFun(p, p)"))
|
||||
@Deprecated("", ReplaceWith("newFun(p, p)"))
|
||||
fun oldFun(p: Int) {
|
||||
newFun(p, p)
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -1,6 +1,6 @@
|
||||
// "Replace with 'newFun(p, p)'" "true"
|
||||
|
||||
@deprecated("", ReplaceWith("newFun(p, p)"))
|
||||
@Deprecated("", ReplaceWith("newFun(p, p)"))
|
||||
fun oldFun(p: Int) {
|
||||
newFun(p, p)
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
// "Replace with 'newFun(p, p)'" "true"
|
||||
|
||||
@deprecated("", ReplaceWith("newFun(p, p)"))
|
||||
@Deprecated("", ReplaceWith("newFun(p, p)"))
|
||||
fun oldFun(p: String) {
|
||||
newFun(p, p)
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -1,6 +1,6 @@
|
||||
// "Replace with 'newFun(p, p)'" "true"
|
||||
|
||||
@deprecated("", ReplaceWith("newFun(p, p)"))
|
||||
@Deprecated("", ReplaceWith("newFun(p, p)"))
|
||||
fun oldFun(p: String) {
|
||||
newFun(p, p)
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -1,6 +1,6 @@
|
||||
// "Replace with 'newFun(p, p)'" "true"
|
||||
|
||||
@deprecated("", ReplaceWith("newFun(p, p)"))
|
||||
@Deprecated("", ReplaceWith("newFun(p, p)"))
|
||||
fun oldFun(p: String) {
|
||||
newFun(p, p)
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -1,6 +1,6 @@
|
||||
// "Replace with 'newFun(p, p)'" "true"
|
||||
|
||||
@deprecated("", ReplaceWith("newFun(p, p)"))
|
||||
@Deprecated("", ReplaceWith("newFun(p, p)"))
|
||||
fun oldFun(p: String) {
|
||||
newFun(p, p)
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -1,6 +1,6 @@
|
||||
// "Replace with 'newFun(p, p)'" "true"
|
||||
|
||||
@deprecated("", ReplaceWith("newFun(p, p)"))
|
||||
@Deprecated("", ReplaceWith("newFun(p, p)"))
|
||||
fun oldFun(p: String) {
|
||||
newFun(p, p)
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -1,6 +1,6 @@
|
||||
// "Replace with 'newFun(p, p)'" "true"
|
||||
|
||||
@deprecated("", ReplaceWith("newFun(p, p)"))
|
||||
@Deprecated("", ReplaceWith("newFun(p, p)"))
|
||||
fun oldFun(p: String) {
|
||||
newFun(p, p)
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// "Replace with 'newFun()'" "true"
|
||||
|
||||
@deprecated("", ReplaceWith("newFun()"))
|
||||
@Deprecated("", ReplaceWith("newFun()"))
|
||||
fun oldFun(): String = ""
|
||||
|
||||
fun newFun(): String = ""
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// "Replace with 'newFun()'" "true"
|
||||
|
||||
@deprecated("", ReplaceWith("newFun()"))
|
||||
@Deprecated("", ReplaceWith("newFun()"))
|
||||
fun oldFun(): String = ""
|
||||
|
||||
fun newFun(): String = ""
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user