Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!

Bug 21979

Summary: Not load classes of form module into VM on startup
Product: guibuilder Reporter: Jaroslav Tulach <jtulach>
Component: CodeAssignee: _ pkuzel <pkuzel>
Status: VERIFIED FIXED QA Contact: issues <issues.netbeans.org>
Priority: P2 CC: issues, tpavek
Version: 3.xKeywords: PERFORMANCE
Target Milestone: 3.x   
Hardware: PC   
OS: Linux   
Whiteboard:
Issue Type: DEFECT Exception Report:
Bug Depends on: 18312, 22422    
Bug Blocks: 21676    

Description Jaroslav Tulach 2002-03-29 14:51:47 UTC
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
Comment 1 Tomas Pavek 2002-04-03 10:23:47 UTC
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
Comment 2 Tomas Pavek 2002-04-10 16:02:05 UTC
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.
Comment 3 Jaroslav Tulach 2002-04-14 15:35:21 UTC
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?

Comment 4 Tomas Pavek 2002-04-15 11:30:52 UTC
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?
Comment 5 _ pkuzel 2002-05-28 16:54:37 UTC
4) fixed, however I do not have an old form to test it properly.
Comment 6 Tomas Pavek 2002-05-29 14:54:25 UTC
So I guess we can mark this FIXED...
Comment 7 Marek Grummich 2005-07-11 12:50:36 UTC
Verified
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo