This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
As part of issue 21676 I have investigated what will happen when ModuleInstall.restore of modules will be called but nothing else. Applied the patch in issue 21676 and started the IDE with -J-Dskip.toolbars=true -J-Dskip.loaders=true -J-Dskip.shortcuts=true -J-Dnetbeans.full.hack=full -J-Dskip.menu=true Following classes has been loaded, please investigate why and make sure that they will not: org.netbeans.modules.form.FormAwareEditor org.netbeans.modules.form.FormEditor org.netbeans.modules.form.FormEditorModule org.netbeans.modules.form.FormEditorModule$1 org.netbeans.modules.form.FormPropertyEditorManager org.netbeans.modules.form.GlobalJarFileSystem org.netbeans.modules.form.GlobalJarFileSystemBeanInfo org.netbeans.modules.form.NamedPropertyEditor org.netbeans.modules.form.palette.BeanInstaller org.netbeans.modules.form.palette.BeanInstaller$1 org.netbeans.modules.form.PersistenceManager org.netbeans.modules.form.PersistenceObjectRegistryo
I've applied the patch and did my own investigation. I've got the following list of loaded classes: org.netbeans.modules.form.editors.KeyStrokeEditor org.netbeans.modules.form.FormEditor org.netbeans.modules.form.FormEditorModule org.netbeans.modules.form.FormEditorModule$1 org.netbeans.modules.form.FormPropertyEditorManager org.netbeans.modules.form.GlobalJarFileSystem org.netbeans.modules.form.GlobalJarFileSystemBeanInfo org.netbeans.modules.form.palette.BeanInstaller org.netbeans.modules.form.palette.BeanInstaller$1 org.netbeans.modules.form.PersistenceManager There are also another form classes loaded: org.netbeans.modules.form.FormAwareEditor org.netbeans.modules.form.NamedPropertyEditor org.netbeans.modules.form.PersistenceObjectRegistry - they are required by i18n module: org.netbeans.modules.i18n.form.I18nFormCrossModule org.netbeans.modules.i18n.form.FormI18nStringEditor What would have to be done to avoid loading the classes? There are three problematic things in FormEditorModule.restored(): (1) BeanInstaller.autoLoadBeans(); (2) PersistenceManager.registerManager( ... ); (3) FormPropertyEditorManager.registerEditor( ... ); and one in I18nFormCrossModule: (4) PersistenceObjectRegistry.registerAlias( ... ); (1) It is already planned to cancel beans autoloading (and to move Timer bean to usersguide module) - issue 18312. This will eliminate the following classes: org.netbeans.modules.form.FormEditor org.netbeans.modules.form.GlobalJarFileSystem org.netbeans.modules.form.GlobalJarFileSystemBeanInfo org.netbeans.modules.form.palette.BeanInstaller org.netbeans.modules.form.palette.BeanInstaller$1 (2) Would require some declarative registration - could be done by layers as only a palin list of classes is registered here. This would reduce: org.netbeans.modules.form.PersistenceManager (3) and (4) use registration of <key, value> pairs. I have currently no idea how to do it declaratively now. This would reduce: org.netbeans.modules.form.FormPropertyEditorManager org.netbeans.modules.form.FormAwareEditor org.netbeans.modules.form.NamedPropertyEditor org.netbeans.modules.form.PersistenceObjectRegistry
Calls (1) and (2) have been removed from FormEditorModule. Calls (3) and (4) cannot be removed now. So we can consider this as FIXED or WONTFIX or change it to ENHANCEMENT.
I have tried to understand the PersistentObjectRegistry and I have failed because of lack of documentation, but it seems to me that the most important method is createInstance and loadClass. Moreover the code seems to duplicate the work of Utilities.translate. What about deleting all the registration methods and letting modules to do the mapping in META-INF/netbeans/translate.names?
PersistenceObjectRegistry always calls Utilities.translate first. So when the translate mechanism is extensible using translate.names file, the registering methods in PersistenceObjectRegistry are really not necessary now. But no matter of that, it is up to i18n to use translate.names instead now... Petr, can you do that?
4) fixed, however I do not have an old form to test it properly.
So I guess we can mark this FIXED...
Verified