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 149557

Summary: DiffFileEncodingQueryImpl class is loaded twice during NetBeans startup with LimeWire project
Product: versioncontrol Reporter: Alexander Kouznetsov <mrkam>
Component: CodeAssignee: Ondrej Vrabec <ovrabec>
Status: REOPENED ---    
Severity: blocker CC: issues, jtulach
Priority: P4 Keywords: PERFORMANCE, TEST
Version: 6.x   
Hardware: PC   
OS: Windows XP   
URL: http://wiki.netbeans.org/FitnessViaWhiteAndBlackList
Issue Type: DEFECT Exception Reporter:
Attachments: Stacktraces
Stacktrace

Description Alexander Kouznetsov 2008-10-08 20:25:30 UTC
Performance whitelist test reports that following classes are loaded during NetBeans startup with LimeWire project:

org.netbeans.modules.versioning.diff.DiffFileEncodingQueryImpl
org.netbeans.modules.versioning.util.queries.DiffFileEncodingQueryImpl

Please don't load these classes unless they are really necessary. More information about the test available via the URL
specified.

Comment from jtulach: 
Why is there similar class twice? maybe P4 or P3.
Comment 1 Alexander Kouznetsov 2008-10-08 20:25:57 UTC
Created attachment 71409 [details]
Stacktraces
Comment 2 Tomas Stupka 2008-10-09 11:08:04 UTC
> Please don't load these classes unless they are really necessary
versionig utilities exprts FileEncodingQueryImplementation. That's what DiffFileEncodingQueryImpl is for.
if DiffFileEncodingQueryImpl gets loaded it's not a cause or fault of vcs 

> Why is there similar class twice?
diff can't use the encoding query facility provided by vcs utilities as it is vcs utilitities which depends on diff ... 


Comment 3 Jaroslav Tulach 2008-10-10 12:22:36 UTC
It is not Alexander's nor performance team primary responsibility to identify whether vcs is responsible or not. We 
just identified that a class is loaded uselessly and reported bug to fix that.

Looking at the DiffFileEncodingQueryImpl, I can see that it returns null for every file having other mimetype than 
text/x-diff. This seems to me that you need to change the registration of the DiffFileEncodingQueryImpl to make the 
class activated only when encoding of such file is in question. Currently I know only about one way to achieve that: 
you can put the query into proper DataObject's getLookup.

> diff can't use the encoding query facility provided by vcs utilities as it is vcs utilitities which depends on diff
It does not sound like real argument to me. Cann't you let vcs use the diff functionality?

Comment 4 Alexander Kouznetsov 2008-10-14 14:36:20 UTC
Another similar class in the list of loaded classes during startup with LimeWire project:

org.netbeans.modules.diff.DiffFileEncodingQueryImplementation

Please don't load this class unless it is really necessary.
Comment 5 Alexander Kouznetsov 2008-10-14 14:37:01 UTC
Created attachment 71768 [details]
Stacktrace