KT-9380 Handle malformed ReplaceWith annotations gracefully

#KT-9380 Fixed
This commit is contained in:
Valentin Kipyatkov
2015-10-02 18:55:31 +03:00
parent 45c3d74b42
commit 2ae13ed76b
3 changed files with 16 additions and 1 deletions
@@ -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");