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 46709 - Action enablement logic does not scale
Summary: Action enablement logic does not scale
Status: RESOLVED FIXED
Alias: None
Product: obsolete
Classification: Unclassified
Component: vcscore (show other bugs)
Version: 4.x
Hardware: PC Linux
: P3 blocker (vote)
Assignee: issues@obsolete
URL:
Keywords: PERFORMANCE
Depends on:
Blocks:
 
Reported: 2004-07-28 15:17 UTC by _ pkuzel
Modified: 2004-08-13 12:12 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description _ pkuzel 2004-07-28 15:17:57 UTC
It uses some home grown ordered Set based on
LinkedList (with slow contains()). Please use
faster LinkedHashSet.

I tried for 10000 files and it already runs for 10
minutes.

        at java.lang.String.equals(String.java:619)
        at
java.util.LinkedList.indexOf(LinkedList.java:398)
        at
java.util.LinkedList.contains(LinkedList.java:176)
        at
org.netbeans.modules.vcscore.util.Table$SimpleSet.add(Table.java:155)
        at
org.netbeans.modules.vcscore.util.Table.keySet(Table.java:83)
        - locked <0x4c7a4790> (a
org.netbeans.modules.vcscore.util.Table)
        at
org.netbeans.modules.vcscore.commands.CommandCustomizationSupport.getApplicableFiles(CommandCustomizationSupport.java:301)
        at
org.netbeans.modules.vcscore.cmdline.UserCommandSupport.getApplicableFiles(UserCommandSupport.java:390)
        at
org.netbeans.modules.vcscore.VcsActionSupporter.isEnabled(VcsActionSupporter.java:109)
        at
org.netbeans.modules.vcscore.VcsActionSupporter.isEnabled(VcsActionSupporter.java:95)
        at
org.netbeans.modules.vcscore.actions.GeneralCommandAction.enable(GeneralCommandAction.java:152)
        at
org.openide.util.actions.NodeAction.isEnabled(NodeAction.java:121)
        at
org.openide.awt.Actions$ButtonBridge.updateState(Actions.java:518)
        at
org.openide.awt.Actions$Bridge.propertyChange(Actions.java:350)
        at
java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:252)
        at
org.openide.util.SharedClassObject.firePropertyChange(SharedClassObject.java:386)
        at
org.openide.util.actions.NodeAction.maybeFireEnabledChange(NodeAction.java:258)
        at
org.openide.util.actions.NodeAction$NodesL.forget(NodeAction.java:381)
        at
org.openide.util.actions.NodeAction$NodesL.update(NodeAction.java:356)
        at
org.openide.util.actions.NodeAction$NodesL.resultChanged(NodeAction.java:348)
        at
org.openide.util.lookup.AbstractLookup.notifyListeners(AbstractLookup.java:405)
        at
org.openide.util.lookup.SimpleProxyLookup$ProxyResult.resultChanged(SimpleProxyLookup.java:215)
        at
sun.reflect.GeneratedMethodAccessor34.invoke(Unknown
Source)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at
java.lang.reflect.Method.invoke(Method.java:324)
        at
org.openide.util.WeakListenerImpl$ProxyListener.invoke(WeakListenerImpl.java:383)
        at $Proxy7.resultChanged(Unknown Source)
        at
org.openide.util.lookup.AbstractLookup.notifyListeners(AbstractLookup.java:405)
        at
org.openide.util.lookup.ProxyLookup$R.resultChanged(ProxyLookup.java:406)
        at
org.openide.util.lookup.ProxyLookup.setLookups(ProxyLookup.java:109)
        at
org.openide.windows.DefaultTopComponentLookup.updateLookups(DefaultTopComponentLookup.java:102)
        at
org.openide.windows.TopComponent.setActivatedNodes(TopComponent.java:215)
        at
org.openide.explorer.ExplorerPanel$PropL.propertyChange(ExplorerPanel.java:324)
        at
org.openide.util.WeakListenerImpl$PropertyChange.propertyChange(WeakListenerImpl.java:131)
        at
java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:252)
        at
org.openide.explorer.ExplorerManager.setSelectedNodes(ExplorerManager.java:219)
  ...
Comment 1 _ pkuzel 2004-07-28 15:20:34 UTC
I can verify in .../bugs/is41/v012/working-directory by selecting all
files.
Comment 2 _ pkuzel 2004-07-29 12:53:07 UTC
LinkedHashMap's times faster. I'll commit.
Comment 3 _ pkuzel 2004-07-29 12:58:30 UTC
Table.java
new revision: 1.8