ReplaceWithAnnotationAnalyzer: should throw ControlFlowException
This commit is contained in:
+3
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
package org.jetbrains.kotlin.idea.quickfix.replaceWith
|
package org.jetbrains.kotlin.idea.quickfix.replaceWith
|
||||||
|
|
||||||
|
import com.intellij.openapi.diagnostic.ControlFlowException
|
||||||
import org.jetbrains.kotlin.config.LanguageVersionSettings
|
import org.jetbrains.kotlin.config.LanguageVersionSettings
|
||||||
import org.jetbrains.kotlin.descriptors.*
|
import org.jetbrains.kotlin.descriptors.*
|
||||||
import org.jetbrains.kotlin.idea.analysis.analyzeInContext
|
import org.jetbrains.kotlin.idea.analysis.analyzeInContext
|
||||||
@@ -59,6 +60,7 @@ object ReplaceWithAnnotationAnalyzer {
|
|||||||
val expression = try {
|
val expression = try {
|
||||||
psiFactory.createExpression(annotation.pattern)
|
psiFactory.createExpression(annotation.pattern)
|
||||||
} catch (t: Throwable) {
|
} catch (t: Throwable) {
|
||||||
|
if (t is ControlFlowException) throw t
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -82,6 +84,7 @@ object ReplaceWithAnnotationAnalyzer {
|
|||||||
val typeReference = try {
|
val typeReference = try {
|
||||||
psiFactory.createType(annotation.pattern)
|
psiFactory.createType(annotation.pattern)
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
|
if (e is ControlFlowException) throw e
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
if (typeReference.typeElement !is KtUserType) return null
|
if (typeReference.typeElement !is KtUserType) return null
|
||||||
|
|||||||
Reference in New Issue
Block a user