TypeMigrationLabeler invokeLater: be prepared to possible PSI invalidations

This commit is contained in:
peter
2016-10-24 18:12:27 +02:00
parent afd3f32362
commit 1cabe6b391
@@ -342,7 +342,11 @@ public class TypeMigrationLabeler {
if (usageInfo instanceof OverriddenUsageInfo) {
final String migrationName = ((OverriddenUsageInfo)usageInfo).getMigrateMethodName();
if (migrationName != null) {
ApplicationManager.getApplication().invokeLater(() -> new RenameProcessor(project, element, migrationName, false, false).run());
ApplicationManager.getApplication().invokeLater(() -> {
if (element.isValid()) {
new RenameProcessor(project, element, migrationName, false, false).run();
}
});
}
}
}