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.

Bug 21952

Summary: Do not load classes on startup
Product: utilities Reporter: Jaroslav Tulach <jtulach>
Component: CodeAssignee: issues@utilities <issues>
Status: CLOSED FIXED    
Severity: blocker Keywords: PERFORMANCE
Priority: P2    
Version: 3.x   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:
Bug Depends on:    
Bug Blocks: 21676    
Attachments: CVS commit report.
Used .instance files with "instanceOf" attribute name assigned.

Description Jaroslav Tulach 2002-03-28 16:42:33 UTC
I am working on issue 21676 and I have run the IDE with this patch
http://www.netbeans.org/issues/showattachment.cgi?attach_id=5081 and the
arguments described there. I have found out that following class is being
loaded into the system on startup. Please investigate why  and
prevent that to happen. Thanks.

org.netbeans.modules.url.BookmarksNode
Comment 1 _ lkramolis 2002-04-03 09:03:31 UTC
Fixed in main trunk.
Comment 2 Jaroslav Tulach 2002-04-04 06:35:44 UTC
Ok, Libor can you tell me what was wrong, I am searching for all ways
that may initialize a module class...
Comment 3 _ lkramolis 2002-04-04 07:08:11 UTC
Created attachment 5284 [details]
CVS commit report.
Comment 4 _ lkramolis 2002-04-04 07:09:44 UTC
See attached CVS commit report. Essentially I changed .instance with
.settings.
Comment 5 Jaroslav Tulach 2002-04-04 08:56:56 UTC
I do not think that replacing .instance with .settings is the best
solution. Processing of .settings takes more time then .instance.

Please continue to use .instance, you can probably use:

<file name="BookmarkNode.instance">
  <attr name="instanceClass" stringvalue="org.openide.nodes.Node" />
  <attr name="instanceCreate"
newvalue="org.netbeans.modules.url.BookmarkNode" />
</file>

which should work the same and not load the class at startup.
Comment 6 _ lkramolis 2002-04-04 09:29:43 UTC
OK, I will revert it to .instance file.

But when you filed this bug I think you should write "'Do not load
classes on startup' bug-fixing guidelines" because I fixed this bug by
.settings files. And if you do not recommend it, you should publish
tips, how to correctly fix it. Thanks.
Comment 7 _ lkramolis 2002-04-04 14:16:37 UTC
Created attachment 5291 [details]
Used .instance files with "instanceOf" attribute name assigned.
Comment 8 _ lkramolis 2002-04-04 14:20:41 UTC
Jardo, I used your proposed solution again by .instance file. I have
extended it with instanceOf attribute name which is necessary:

<attr name="instanceOf" stringvalue="org.openide.nodes.Node,
org.openide.nodes.AbstractNode, org.openide.loaders.DataNode,
org.openide.loaders.DataFolder$FolderNode,
org.netbeans.modules.url.BookmarksNode" />

Is it right now?
Comment 9 Jaroslav Tulach 2002-04-13 14:11:27 UTC
Seems like BookmarkNode is gone. 

Other possible trick is to write 

<attr name="instanceClass" stringvalue="org.openide.nodes.Node" />

then you might skip the instanceOf attribute.
Comment 10 Quality Engineering 2003-07-01 15:31:38 UTC
Resolved for 3.4.x or earlier, no new info since then -> closing.