mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
extract method object: no need to change signature when nothing was changed by duplicates processing (IDEA-98288)
This commit is contained in:
@@ -380,8 +380,9 @@ public final class Match {
|
||||
}
|
||||
|
||||
public void changeSignature(final PsiMethod psiMethod) {
|
||||
final ArrayList<ParameterInfoImpl> newParameters = patchParams(psiMethod);
|
||||
final PsiType expressionType = getChangedReturnType(psiMethod);
|
||||
if (expressionType == null && myChangedParams.isEmpty()) return;
|
||||
final ArrayList<ParameterInfoImpl> newParameters = patchParams(psiMethod);
|
||||
final ChangeSignatureProcessor csp = new ChangeSignatureProcessor(psiMethod.getProject(), psiMethod, false, null, psiMethod.getName(),
|
||||
expressionType != null ? expressionType : psiMethod.getReturnType(),
|
||||
newParameters.toArray(new ParameterInfoImpl[newParameters.size()]));
|
||||
|
||||
@@ -19,6 +19,7 @@ import com.intellij.JavaTestUtil;
|
||||
import com.intellij.codeInsight.CodeInsightUtil;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.PsiDocumentManager;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiExpression;
|
||||
import com.intellij.psi.PsiFile;
|
||||
@@ -677,6 +678,7 @@ public class ExtractMethodTest extends LightCodeInsightTestCase {
|
||||
final List<Match> duplicates = processor.getDuplicates();
|
||||
for (final Match match : duplicates) {
|
||||
if (!match.getMatchStart().isValid() || !match.getMatchEnd().isValid()) continue;
|
||||
PsiDocumentManager.getInstance(project).commitAllDocuments();
|
||||
processor.processMatch(match);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user