mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-18 12:31:26 +07:00
[project structure] avoid unnecessary creation of ModifiableRootModel in ModuleConfigurationState
This commit introduces ModuleConfigurationState::getCurrentRootModel method which can be used if we need to just read the current state of the model and don't need to modify it, and explicit 'getModifiableRootModel' method. The old 'getRootModel' method is deprecated and all its usages are replaced by usages of one of the new methods. This way we avoid creating unnecessary instances of ModifiableRootModel to improve performance and avoid exceptions (EA-251419) which may happen if ModifiableRootModel is created during commit (when ClasspathPanelImpl creates modifiable model to update the table during processing 'rootsChanged'). GitOrigin-RevId: 4cbd410ed6039a5ee652d2585bdeee429baf7df7
This commit is contained in:
committed by
intellij-monorepo-bot
parent
ea4b95e631
commit
804cff19da
@@ -18,7 +18,7 @@ import java.util.List;
|
||||
public class PythonModuleConfigurationEditorProvider implements ModuleConfigurationEditorProvider {
|
||||
@Override
|
||||
public ModuleConfigurationEditor[] createEditors(final ModuleConfigurationState state) {
|
||||
final Module module = state.getRootModel().getModule();
|
||||
final Module module = state.getCurrentRootModel().getModule();
|
||||
if (!(ModuleType.get(module) instanceof PythonModuleType)) return ModuleConfigurationEditor.EMPTY;
|
||||
final DefaultModuleConfigurationEditorFactory editorFactory = DefaultModuleConfigurationEditorFactory.getInstance();
|
||||
final List<ModuleConfigurationEditor> editors = new ArrayList<>();
|
||||
|
||||
Reference in New Issue
Block a user