KT-13170 related: correct handling of inspection parameters in additional checker

(cherry picked from commit 47fd990)
This commit is contained in:
Mikhail Glukhikh
2016-07-26 18:07:40 +03:00
committed by Mikhail Glukhikh
parent ff2f49fa8f
commit 17c824f7f2
6 changed files with 28 additions and 12 deletions
@@ -38,7 +38,11 @@ class HasPlatformTypeInspection(
@JvmField var reportPlatformArguments: Boolean = false
) : IntentionBasedInspection<KtCallableDeclaration>(
intention,
{ intention.dangerousFlexibleTypeOrNull(it, publicAPIOnly, reportPlatformArguments) != null }
{ element, inspection ->
with(inspection as HasPlatformTypeInspection) {
intention.dangerousFlexibleTypeOrNull(element, this.publicAPIOnly, this.reportPlatformArguments) != null
}
}
) {
override val problemHighlightType = ProblemHighlightType.WEAK_WARNING
@@ -36,7 +36,7 @@ class ConvertLambdaToReferenceInspection(
val intention: ConvertLambdaToReferenceIntention = ConvertLambdaToReferenceIntention()
) : IntentionBasedInspection<KtLambdaExpression>(
intention,
{ intention.shouldSuggestToConvert(it) }
{ it -> intention.shouldSuggestToConvert(it) }
)
class ConvertLambdaToReferenceIntention : SelfTargetingOffsetIndependentIntention<KtLambdaExpression>(
@@ -30,7 +30,7 @@ import org.jetbrains.kotlin.resolve.lazy.BodyResolveMode
class ConvertToStringTemplateInspection : IntentionBasedInspection<KtBinaryExpression>(
ConvertToStringTemplateIntention(),
{ ConvertToStringTemplateIntention().shouldSuggestToConvert(it) }
{ it -> ConvertToStringTemplateIntention().shouldSuggestToConvert(it) }
)
class ConvertToStringTemplateIntention : SelfTargetingOffsetIndependentIntention<KtBinaryExpression>(KtBinaryExpression::class.java, "Convert concatenation to template") {
@@ -29,7 +29,7 @@ class RemoveSetterParameterTypeInspection(
val intention: RemoveExplicitTypeIntention = RemoveExplicitTypeIntention()
) : IntentionBasedInspection<KtCallableDeclaration>(
intention,
{ intention.isSetterParameter(it) }
{ it -> intention.isSetterParameter(it) }
) {
override val problemHighlightType = ProblemHighlightType.LIKE_UNUSED_SYMBOL