Remove useless code to determine default visibility

This commit is contained in:
Alexey Belkov
2018-03-09 23:14:18 +03:00
committed by Nikolay Krasko
parent daf6036bc0
commit f3bb952148
2 changed files with 4 additions and 12 deletions
@@ -236,18 +236,17 @@ open class KotlinChangeInfo(
fun getNewSignature(inheritedCallable: KotlinCallableDefinitionUsage<PsiElement>): String {
val buffer = StringBuilder()
val defaultVisibility = if (kind.isConstructor) Visibilities.PUBLIC else Visibilities.DEFAULT_VISIBILITY
val isCustomizedVisibility = newVisibility != Visibilities.DEFAULT_VISIBILITY
if (kind == Kind.PRIMARY_CONSTRUCTOR) {
buffer.append(name)
if (newVisibility != defaultVisibility) {
if (isCustomizedVisibility) {
buffer.append(' ').append(newVisibility).append(" constructor ")
}
}
else {
if (!DescriptorUtils.isLocal(inheritedCallable.originalCallableDescriptor) && newVisibility != defaultVisibility) {
if (!DescriptorUtils.isLocal(inheritedCallable.originalCallableDescriptor) && isCustomizedVisibility) {
buffer.append(newVisibility).append(' ')
}