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 156017 - org.netbeans.modules.cnd.editor classes are loaded during NetBeans startup with LimeWire project
Summary: org.netbeans.modules.cnd.editor classes are loaded during NetBeans startup wi...
Status: VERIFIED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P2 blocker (vote)
Assignee: Vladimir Voskresensky
URL: http://wiki.netbeans.org/FitnessViaWh...
Keywords: PERFORMANCE, REGRESSION, TEST
Depends on:
Blocks:
 
Reported: 2008-12-23 19:09 UTC by Alexander Kouznetsov
Modified: 2009-02-19 20:30 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Stacktraces (17.40 KB, text/plain)
2008-12-23 19:09 UTC, Alexander Kouznetsov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Kouznetsov 2008-12-23 19:09:25 UTC
Performance test reports there is a regression in NetBeans startup with LimeWire project which is caused by the loading
of the following classes:

org.netbeans.modules.cnd.editor.fortran.reformat.FortranReformatter$Factory
org.netbeans.modules.cnd.editor.indent.CppIndentFactory
org.netbeans.modules.cnd.editor.makefile.MakefileIndentTaskFactory

Please don't load these classes unless they're really necessary.

More information is available via the URL specified.
Comment 1 Alexander Kouznetsov 2008-12-23 19:09:58 UTC
Created attachment 75280 [details]
Stacktraces
Comment 2 Vladimir Voskresensky 2008-12-23 21:19:52 UTC
will fix
Comment 3 Vladimir Voskresensky 2008-12-23 21:52:58 UTC
The reason I can see is caused by:
          org.openide.loaders.InstanceDataObject.instanceOf(InstanceDataObject.java:737)
          org.netbeans.modules.editor.impl.KitsTrackerImpl.isInstanceOf(KitsTrackerImpl.java:321)
          org.netbeans.modules.editor.impl.KitsTrackerImpl.findKitRegistration(KitsTrackerImpl.java:305)
and CND classes are instantiated due to the absence of "instanceOf" attribute => lookup in editor folders needs to
instantiate class to process "instanceOf" check, so I will fix such places in CND by adding needed "instanceOf" attributes.
Comment 4 Vladimir Voskresensky 2008-12-23 21:54:53 UTC
But it means, that 
VV1: all other languages should do the same for all *.instance files in Editor/mime-type folder, 
i.e. Java editor can do the same to delay instantiation of some classes on start up:
   <folder name="Editors">
       <folder name="text">
            <folder name="x-java">
                <file name="Reformatter.instance">
                    <attr name="instanceClass" stringvalue="org.netbeans.modules.java.source.save.Reformatter$Factory"/>
                </file>
                <file name="JavacParser.instance">
                    <attr name="instanceClass" stringvalue="org.netbeans.modules.java.source.parsing.JavacParserFactory"/>
                </file>
            </folder>

VV2: As another approach (for editor impl):
 speed up could be achieved by putting Kits registrations in own folder => only small Editor/mime-type/Kit  folder will
be analyzed instead of full content of Editor/mime-type folder, but that probably is not good, because not compatible
change. 

So, I think it's easier to write automatic test to track "VV1" all *.instance files in Editor/mime-type folder without
"instanceOf" attribute and inform developer about that as "problem"
Comment 5 Vladimir Voskresensky 2008-12-23 22:06:38 UTC
fixed
http://hg.netbeans.org/main?cmd=changeset;node=7539bf5da86a

Please, verify
Comment 6 Quality Engineering 2008-12-24 16:56:11 UTC
Integrated into 'main-golden', will be available in build *200812241401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/7539bf5da86a
User: Vladimir Voskresensky <vv159170@netbeans.org>
Log: fixed IZ#156017: org.netbeans.modules.cnd.editor classes are loaded during NetBeans startup with LimeWire project
Comment 7 Alexander Kouznetsov 2009-01-14 14:26:03 UTC
Verified with 090111