KT-9380 Handle malformed ReplaceWith annotations gracefully
#KT-9380 Fixed
This commit is contained in:
+1
-1
@@ -85,7 +85,7 @@ object ReplaceWithAnnotationAnalyzer {
|
||||
var expression = try {
|
||||
psiFactory.createExpression(annotation.pattern)
|
||||
}
|
||||
catch(e: Exception) {
|
||||
catch(t: Throwable) {
|
||||
return null
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
// "class org.jetbrains.kotlin.idea.quickfix.replaceWith.DeprecatedSymbolUsageFix" "false"
|
||||
|
||||
@Deprecated("", ReplaceWith("order.safeAddItem(...)"))
|
||||
fun oldFun() {
|
||||
}
|
||||
|
||||
fun foo() {
|
||||
<caret>oldFun()
|
||||
}
|
||||
@@ -3130,6 +3130,12 @@ public class QuickFixTestGenerated extends AbstractQuickFixTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("mailformedExpression.kt")
|
||||
public void testMailformedExpression() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/quickfix/deprecatedSymbolUsage/mailformedExpression.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("memberFunction.kt")
|
||||
public void testMemberFunction() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/quickfix/deprecatedSymbolUsage/memberFunction.kt");
|
||||
|
||||
Reference in New Issue
Block a user