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 225418

Summary: Schedule source roots refresh to one thread only.
Product: debugger Reporter: Martin Entlicher <mentlicher>
Component: JavaAssignee: Martin Entlicher <mentlicher>
Status: RESOLVED FIXED    
Severity: normal Keywords: PERFORMANCE
Priority: P3    
Version: 7.3   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description Martin Entlicher 2013-01-28 15:35:54 UTC
As can be seen from http://bugzilla-attachments-225311.netbeans.org/bugzilla/attachment.cgi?id=130677, there can be multiple threads doing the same expensive work - refreshing source roots and creating the new class path.

This can be optimized to schedule the work to just one thread, that would be postponed as new requests for refresh come.

"JPDA Debugger" daemon prio=2 tid=0x0dbee800 nid=0x1048 runnable [0x077bf000]
   java.lang.Thread.State: RUNNABLE
	at java.io.WinNTFileSystem.canonicalize0(Native Method)
	at java.io.Win32FileSystem.canonicalize(Win32FileSystem.java:414)
	at java.io.File.getCanonicalPath(File.java:589)
	at java.io.File.getCanonicalFile(File.java:614)
	at org.openide.filesystems.FileUtil.normalizeFileOnWindows(FileUtil.java:1707)
	at org.openide.filesystems.FileUtil.normalizeFileImpl(FileUtil.java:1598)
	at org.openide.filesystems.FileUtil.normalizeFileCached(FileUtil.java:1579)
	at org.openide.filesystems.FileUtil.normalizeFile(FileUtil.java:1561)
	at org.openide.filesystems.FileUtil.toFile(FileUtil.java:826)
	at org.netbeans.core.startup.layers.ArchiveURLMapper.getFileObjects(ArchiveURLMapper.java:134)
	at org.openide.filesystems.URLMapper.findFileObject(URLMapper.java:213)
	at org.netbeans.modules.debugger.jpda.projects.SourcePathProviderImpl.createClassPath(SourcePathProviderImpl.java:1364)
	at org.netbeans.modules.debugger.jpda.projects.SourcePathProviderImpl.access$400(SourcePathProviderImpl.java:113)
	at org.netbeans.modules.debugger.jpda.projects.SourcePathProviderImpl$PathRegistryListener.rootsChanged(SourcePathProviderImpl.java:1578)
	- locked <0x320aaee0> (a org.netbeans.modules.debugger.jpda.projects.SourcePathProviderImpl)
	at org.netbeans.modules.debugger.jpda.projects.SourcePathProviderImpl$PathRegistryListener.access$200(SourcePathProviderImpl.java:1467)
	at org.netbeans.modules.debugger.jpda.projects.SourcePathProviderImpl$PathRegistryListener$1.run(SourcePathProviderImpl.java:1480)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1454)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2048)
Comment 1 Martin Entlicher 2013-08-30 15:59:17 UTC
Fixed by changeset:   263201:d42f37e087fa
http://hg.netbeans.org/core-main/rev/d42f37e087fa