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 102612 - Unnecessary File.listRoots() in AWT
Summary: Unnecessary File.listRoots() in AWT
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: I18N (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P3 blocker (vote)
Assignee: Alexey Butenko
URL:
Keywords: API, API_REVIEW_FAST, PERFORMANCE
Depends on:
Blocks:
 
Reported: 2007-04-26 13:03 UTC by Maros Sandor
Modified: 2009-03-26 15:04 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
patch for the Internationalization module (5.83 KB, patch)
2007-09-05 10:52 UTC, Tomas Stupka
Details | Diff
patch for the Internationalization of Form module (3.75 KB, application/octet-stream)
2007-09-05 10:53 UTC, Tomas Stupka
Details
patch for api review (8.02 KB, patch)
2009-03-20 11:45 UTC, Alexey Butenko
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Maros Sandor 2007-04-26 13:03:26 UTC
While working with Form editor, I want to assign a tooltip for a button. This
call below takes some 20 seconds to execute on my system.

"AWT-EventQueue-1" prio=6 tid=0x1cfcdc00 nid=0xf7c runnable [0x1e9af000..0x1e9afd14]
   java.lang.Thread.State: RUNNABLE
        at java.io.WinNTFileSystem.getBooleanAttributes(Native Method)
        at java.io.File.isDirectory(File.java:754)
        at java.io.File.toURI(File.java:661)
        at org.openide.filesystems.FileUtil.fileToURL(FileUtil.java:540)
        at org.openide.filesystems.FileUtil.toFileObject(FileUtil.java:517)
        at
org.netbeans.modules.i18n.I18nOptions.getFileSystems(I18nOptions.java:202)
        at
org.netbeans.modules.i18n.I18nOptions.findFileObject(I18nOptions.java:216)
        at
org.netbeans.modules.i18n.I18nOptions.getLastResource2(I18nOptions.java:169)
        at
org.netbeans.modules.i18n.form.FormI18nStringEditor.getCustomEditor(FormI18nStringEditor.java:168)
        at
org.netbeans.modules.form.FormCustomEditor.<init>(FormCustomEditor.java:151)
        at
org.netbeans.modules.form.FormPropertyEditor.getCustomEditor(FormPropertyEditor.java:268)
        at
org.openide.explorer.propertysheet.PropertyDialogManager.<init>(PropertyDialogManager.java:104)
        at
org.openide.explorer.propertysheet.CustomEditorAction.actionPerformed(CustomEditorAction.java:195)
        at
org.openide.explorer.propertysheet.SheetTable.processMouseEvent(SheetTable.java:687)
        at java.awt.Component.processEvent(Component.java:5803)
        at java.awt.Container.processEvent(Container.java:2058)
        at java.awt.Component.dispatchEventImpl(Component.java:4410)
        at java.awt.Container.dispatchEventImpl(Container.java:2116)
        at java.awt.Component.dispatchEvent(Component.java:4240)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
        at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3983)
        at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
        at java.awt.Container.dispatchEventImpl(Container.java:2102)
        at java.awt.Window.dispatchEventImpl(Window.java:2429)
        at java.awt.Component.dispatchEvent(Component.java:4240)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
        at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
        at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
        at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
Comment 1 Marian Petras 2007-04-26 13:40:00 UTC
Confirmed. The I18n module traverses over roots of all filesystems of the
computer and tries to find a file having a given path on them. It is probably an
old code from pre-projects era. There is no need for searching all computer - it
is sufficient to search the current project.
Comment 2 Tomas Stupka 2007-09-05 10:51:10 UTC
will be fixed after 6.0 as it would cause an api change
attaching patch
Comment 3 Tomas Stupka 2007-09-05 10:52:28 UTC
Created attachment 48138 [details]
patch for the Internationalization module
Comment 4 Tomas Stupka 2007-09-05 10:53:28 UTC
Created attachment 48139 [details]
patch for the Internationalization of Form module
Comment 5 Alexey Butenko 2009-03-20 11:45:34 UTC
Created attachment 78506 [details]
patch for api review
Comment 6 Alexey Butenko 2009-03-20 11:50:11 UTC
API change: 
 method getLastResource2() is deprecated
 added method getLastResource2(DataObject srcDataObject)
Comment 7 Alexey Butenko 2009-03-25 12:15:11 UTC
Ok, if there is no objections, I'm going to integrate the patch in 24 hours.
Comment 8 Alexey Butenko 2009-03-26 15:04:56 UTC
changeset ad2844f61821