Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import com.intellij.java.language.psi.util.PsiUtil;
import com.intellij.java.language.psi.util.TypeConversionUtil;
import consulo.annotation.access.RequiredReadAction;
import consulo.annotation.access.RequiredWriteAction;
import consulo.language.editor.refactoring.util.CommonRefactoringUtil;
import consulo.language.editor.ui.util.DocCommentPolicy;
import consulo.language.psi.PsiElement;
Expand Down Expand Up @@ -124,7 +125,7 @@ else if (element.getParent() instanceof PsiReferenceList refList) {
if (refList.getParent() instanceof PsiClass inheritor
&& (refList.equals(inheritor.getExtendsList()) || refList.equals(inheritor.getImplementsList()))) {
usages.add(new ReplaceExtendsListUsageInfo(
(PsiJavaCodeReferenceElement)element,
(PsiJavaCodeReferenceElement) element,
mySuperClass,
inheritor
));
Expand Down Expand Up @@ -198,7 +199,7 @@ else if (element.getParent() instanceof PsiJavaCodeReferenceElement parentCodeRe
if (superConstructor.getParameterList().getParametersCount() == 0) {
PsiExpression expression =
JavaPsiFacade.getElementFactory(myProject).createExpressionFromText("super()", constructor);
usages.add(new InlineSuperCallUsageInfo((PsiMethodCallExpression)expression, constrBody));
usages.add(new InlineSuperCallUsageInfo((PsiMethodCallExpression) expression, constrBody));
}
}
}
Expand Down Expand Up @@ -259,7 +260,7 @@ private static PsiType getPlaceExpectedType(PsiElement parent) {
PsiParameter[] parameters = method.getParameterList().getParameters();
if (i >= parameters.length) {
if (method.isVarArgs()) {
return ((PsiEllipsisType)parameters[parameters.length - 1].getType()).getComponentType();
return ((PsiEllipsisType) parameters[parameters.length - 1].getType()).getComponentType();
}
}
else {
Expand All @@ -285,6 +286,7 @@ protected boolean showConflicts(@Nonnull MultiMap<PsiElement, String> conflicts,

@Override
@RequiredUIAccess
@RequiredWriteAction
protected void performRefactoring(@Nonnull UsageInfo[] pushDownUsages) {
if (myCurrentInheritor != null) {
encodeRefs();
Expand All @@ -297,7 +299,7 @@ protected void performRefactoring(@Nonnull UsageInfo[] pushDownUsages) {
for (UsageInfo usageInfo : usages) {
if (!(usageInfo instanceof ReplaceExtendsListUsageInfo || usageInfo instanceof RemoveImportUsageInfo)) {
try {
((FixableUsageInfo)usageInfo).fixUsage();
((FixableUsageInfo) usageInfo).fixUsage();
}
catch (IncorrectOperationException e) {
LOG.info(e);
Expand All @@ -309,7 +311,7 @@ protected void performRefactoring(@Nonnull UsageInfo[] pushDownUsages) {
//postpone broken hierarchy
for (UsageInfo usage : usages) {
if (usage instanceof ReplaceExtendsListUsageInfo || usage instanceof RemoveImportUsageInfo) {
((FixableUsageInfo)usage).fixUsage();
((FixableUsageInfo) usage).fixUsage();
}
}
if (myCurrentInheritor == null) {
Expand All @@ -324,6 +326,7 @@ protected void performRefactoring(@Nonnull UsageInfo[] pushDownUsages) {
}.run();
}

@RequiredWriteAction
private void replaceInnerTypeUsages() {
JavaPsiFacade facade = JavaPsiFacade.getInstance(myProject);
PsiElementFactory elementFactory = facade.getElementFactory();
Expand Down Expand Up @@ -411,6 +414,6 @@ private static PsiSubstitutor getSuperClassSubstitutor(
@Nonnull
@Override
protected String getCommandName() {
return InlineSuperClassRefactoringHandler.REFACTORING_NAME;
return InlineSuperClassRefactoringHandler.REFACTORING_NAME.get();
}
}
Loading