diff --git a/.idea/ant.xml b/.idea/ant.xml deleted file mode 100644 index bbff6871e08..00000000000 --- a/.idea/ant.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/idea/src/org/jetbrains/kotlin/idea/refactoring/jetRefactoringUtil.kt b/idea/src/org/jetbrains/kotlin/idea/refactoring/jetRefactoringUtil.kt index 3ec5a5daae2..64f50261d9a 100644 --- a/idea/src/org/jetbrains/kotlin/idea/refactoring/jetRefactoringUtil.kt +++ b/idea/src/org/jetbrains/kotlin/idea/refactoring/jetRefactoringUtil.kt @@ -709,3 +709,5 @@ public fun KtClass.createPrimaryConstructorParameterListIfAbsent(): KtParameterL if (parameterList != null) return parameterList return constructor.add(KtPsiFactory(project).createParameterList("()")) as KtParameterList } + +fun PsiNamedElement.isInterfaceClass(): Boolean = this is KtClass && isInterface() || this is PsiClass && isInterface diff --git a/idea/src/org/jetbrains/kotlin/idea/refactoring/memberInfo/KotlinMemberInfoStorage.kt b/idea/src/org/jetbrains/kotlin/idea/refactoring/memberInfo/KotlinMemberInfoStorage.kt index 1f31877dd50..8a476e9696f 100644 --- a/idea/src/org/jetbrains/kotlin/idea/refactoring/memberInfo/KotlinMemberInfoStorage.kt +++ b/idea/src/org/jetbrains/kotlin/idea/refactoring/memberInfo/KotlinMemberInfoStorage.kt @@ -79,14 +79,16 @@ public class KotlinMemberInfoStorage( && !(it is KtObjectDeclaration && it.isCompanion()) && myFilter.includeMember(it) } .mapTo(temp) { KotlinMemberInfo(it as KtNamedDeclaration) } - aClass.getDelegationSpecifiers() - .filterIsInstance() - .map { - val type = context[BindingContext.TYPE, it.typeReference] - val classDescriptor = type?.constructor?.declarationDescriptor as? ClassDescriptor - classDescriptor?.source?.getPsi() as? KtClass - } - .filter { it != null && it.isInterface() } - .mapTo(temp) { KotlinMemberInfo(it!!, true) } + if (aClass == myClass) { + aClass.getDelegationSpecifiers() + .filterIsInstance() + .map { + val type = context[BindingContext.TYPE, it.typeReference] + val classDescriptor = type?.constructor?.declarationDescriptor as? ClassDescriptor + classDescriptor?.source?.getPsi() as? KtClass + } + .filter { it != null && it.isInterface() } + .mapTo(temp) { KotlinMemberInfo(it!!, true) } + } } } \ No newline at end of file diff --git a/idea/src/org/jetbrains/kotlin/idea/refactoring/pullUp/KotlinPullUpDialog.kt b/idea/src/org/jetbrains/kotlin/idea/refactoring/pullUp/KotlinPullUpDialog.kt index 42a82d4dbd6..d00043681d6 100644 --- a/idea/src/org/jetbrains/kotlin/idea/refactoring/pullUp/KotlinPullUpDialog.kt +++ b/idea/src/org/jetbrains/kotlin/idea/refactoring/pullUp/KotlinPullUpDialog.kt @@ -26,6 +26,7 @@ import com.intellij.refactoring.classMembers.AbstractMemberInfoModel import com.intellij.refactoring.memberPullUp.PullUpProcessor import com.intellij.refactoring.util.DocCommentPolicy import org.jetbrains.kotlin.asJava.toLightClass +import org.jetbrains.kotlin.idea.core.refactoring.isInterfaceClass import org.jetbrains.kotlin.idea.refactoring.memberInfo.* import org.jetbrains.kotlin.psi.* @@ -89,7 +90,7 @@ public class KotlinPullUpDialog( override fun createMemberInfoModel() = MemberInfoModelImpl() - override fun getPreselection() = mySuperClasses.firstOrNull() + override fun getPreselection() = mySuperClasses.firstOrNull { !it.isInterfaceClass() } ?: mySuperClasses.firstOrNull() override fun createMemberSelectionTable(infos: MutableList) = KotlinMemberSelectionTable(infos, null, "Make abstract")