mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
create parameter from usage: invokeLater for tests same as normal case (to avoid refactoring start from write action)
This commit is contained in:
+15
-15
@@ -97,19 +97,19 @@ public class CreateParameterFromUsageFix extends CreateVarFromUsageFix {
|
||||
}
|
||||
|
||||
final Application application = ApplicationManager.getApplication();
|
||||
if (application.isUnitTestMode()) {
|
||||
ParameterInfoImpl[] array = parameterInfos.toArray(new ParameterInfoImpl[parameterInfos.size()]);
|
||||
String modifier = PsiUtil.getAccessModifier(PsiUtil.getAccessLevel(method.getModifierList()));
|
||||
ChangeSignatureProcessor processor =
|
||||
new ChangeSignatureProcessor(project, method, false, modifier, method.getName(), method.getReturnType(), array);
|
||||
processor.run();
|
||||
}
|
||||
else {
|
||||
final PsiMethod finalMethod = method;
|
||||
application.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (project.isDisposed()) return;
|
||||
final PsiMethod finalMethod = method;
|
||||
application.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (project.isDisposed()) return;
|
||||
if (application.isUnitTestMode()) {
|
||||
ParameterInfoImpl[] array = parameterInfos.toArray(new ParameterInfoImpl[parameterInfos.size()]);
|
||||
String modifier = PsiUtil.getAccessModifier(PsiUtil.getAccessLevel(finalMethod.getModifierList()));
|
||||
ChangeSignatureProcessor processor =
|
||||
new ChangeSignatureProcessor(project, finalMethod, false, modifier, finalMethod.getName(), finalMethod.getReturnType(), array);
|
||||
processor.run();
|
||||
}
|
||||
else {
|
||||
try {
|
||||
JavaChangeSignatureDialog dialog =
|
||||
JavaChangeSignatureDialog.createAndPreselectNew(project, finalMethod, parameterInfos, true, myReferenceExpression);
|
||||
@@ -141,8 +141,8 @@ public class CreateParameterFromUsageFix extends CreateVarFromUsageFix {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user