Cleanup: join declaration & assignment applied

This commit is contained in:
Mikhail Glukhikh
2016-11-25 11:40:58 +03:00
parent e63abff7e8
commit 96ae881c16
3 changed files with 10 additions and 19 deletions
@@ -21,11 +21,7 @@ import java.text.MessageFormat
abstract class AbstractDiagnosticWithParametersRenderer<D : Diagnostic> protected constructor(message: String) : DiagnosticRenderer<D> {
private val messageFormat: MessageFormat
init {
messageFormat = MessageFormat(message)
}
private val messageFormat = MessageFormat(message)
override fun render(obj: D): String {
return messageFormat.format(renderParameters(obj))
@@ -34,14 +34,10 @@ class KotlinBasicStepMethodFilter(
val descriptor: CallableDescriptor,
val myCallingExpressionLines: Range<Int>
) : NamedMethodFilter {
private val myTargetMethodName: String
init {
myTargetMethodName = when (descriptor) {
is ClassDescriptor, is ConstructorDescriptor -> "<init>"
is PropertyAccessorDescriptor -> JvmAbi.getterName(descriptor.correspondingProperty.name.asString())
else -> descriptor.name.asString()
}
private val myTargetMethodName = when (descriptor) {
is ClassDescriptor, is ConstructorDescriptor -> "<init>"
is PropertyAccessorDescriptor -> JvmAbi.getterName(descriptor.correspondingProperty.name.asString())
else -> descriptor.name.asString()
}
override fun getCallingExpressionLines() = myCallingExpressionLines
@@ -47,7 +47,11 @@ class LetImplementInterfaceFix(
private val prefix: String
private val validExpectedType: Boolean
private val validExpectedType = with (expectedType) {
isInterface() &&
!containsStarProjections() &&
constructor !in TypeUtils.getAllSupertypes(expressionType).map(KotlinType::constructor)
}
init {
val expectedTypeNotNullable = TypeUtils.makeNotNullable(expectedType)
@@ -58,11 +62,6 @@ class LetImplementInterfaceFix(
val typeDescription = if (element.isObjectLiteral()) "the anonymous object" else "'${expressionType.renderShort()}'"
prefix = "Let $typeDescription $verb"
validExpectedType = with (expectedType) {
isInterface() &&
!containsStarProjections() &&
constructor !in TypeUtils.getAllSupertypes(expressionType).map(KotlinType::constructor)
}
}
override fun getFamilyName() = "Let type implement interface"