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.
Steps to reproduction: 1) Show NetBeans Platfrom dialog 2) Click to add New platform button 3) Select a platform folder (the folder is not in system disk cache) 4) Click to finish It takes few seconds on my system. The action blocks in AWT quee. It is better to use RequestProcessor and show progressbar.
Yes. We shouldn't block AWT queue. Probably a modal dialog with progress bar with "Loading NetBeans Platform's metadata" message or something similar? I'll go that way if anybody (HIE, Jesse, ...) doesn't have other opinion (e.g. some standard NB approach I've missed)
I think you can disable both Next and Finish buttons while doing computation, rather than showing a modal progress dialog on top of a wizard, which is sort of ugly. I am sure there is some example elsewhere, but can't remember where. By the way, what exactly is so slow that it needs a progress dialog? AFAIK all the wizard needs to do is check for the platform's display name, which ought to be pretty fast since it just needs to open a couple of JARs and look for some bundles. Reporter, any thread dumps or profiler results?
Created attachment 23587 [details] blocked AWT-EVENT-QUEUE
I attached AWT-EVENT-QUEUE dump. The time is spent in ModuleList.createModuleListFromBinaries() There are opened jars of netbeans modules. It takes a lot of time. Jesse, do you plan to implement cache for nbplatform? IHMO it is useless to open all the jars of platform everytime the platchorm is touched. For example te cache can contain these informations: 1) the absolute path in filesystem to platform (key) 2) list of all jars in platform For a jar should be cached these informations: -location and name in platfrom -timestamp and size -manifest and layer xml
Isn't this thread dump intended rather for the issue 59550? Attaching threaddump you probably meant.
Created attachment 23599 [details] right thread dump
Ah. In NbPCM.setPlatform, in place of moduleList.setModel(new ComponentFactory.ModuleEntryListModel(plaf.getModules())); just use e.g. moduleList.setModel(new DefaultListModel(new Object[] {"Please wait..."}); RequestProcessor.getDefault().post(new Runnable() { public void run() { final ModuleEntry[] modules = plaf.getModules(); EventQueue.invokeLater(new Runnable() { public void run() { moduleList.setModel(new ComponentFactory.ModuleEntryListModel(modules)); } }); } }); I doubt a progress bar is really needed for this; it's only a displayed list, analogous to the "Required Projects" list in the Open Project dialog.
Thanks. Fixed. Checking in ui/platform/NbPlatformCustomizerModules.java; 1.2 --> 1.3
v