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 269121

Summary: Breakpoints cause unneeded lengthy loading of projects
Product: debugger Reporter: NukemBy
Component: JavaAssignee: Martin Entlicher <mentlicher>
Status: NEW ---    
Severity: normal    
Priority: P2    
Version: Dev   
Hardware: PC   
OS: Windows 7   
Issue Type: DEFECT Exception Reporter:

Description NukemBy 2016-11-25 16:13:14 UTC
I have a huge project whose load takes 2-3 minutes, of course I have some breakpoints set across its code and this causes hidden problems upon startup of NetBeans with completely different initial Project Group with tiny project, which should load pretty quicky (few seconds).

According to my observation, even with Project Group == 'none' JDPA during startup initialization ...
- goes through all breakpoints and source roots defined in 'org-netbeans-modules-debugger-Settings.properties' ...
- this invokes 'ProjectManager.getDefault().findProject(f)' for each of them ...
- and implementation of findProject(...) is not actually 'find', it is rather 'try create and return the resulting Project if successful', as defined in JavaDoc comments here
http://hg.netbeans.org/main/file/806609df7b20/projectapi/src/org/netbeans/api/project/ProjectManager.java#l135 
This means - project will be loaded even when it is not needed, method does not have flag "find only already loaded projects".

So, it appears with all these pieces together each time I start NetBeans I have to wait 2-3 minutes while it loads actually not needed projects, otherwise some actions just do not work. This is really annoying.

Below is the callstack (I'm using Gradle plugin):

"Asynchronous view model"
	at org.netbeans.gradle.project.NbGradleProjectFactory.loadProject(NbGradleProjectFactory.java:238)
	at org.netbeans.modules.projectapi.nb.NbProjectManager.createProject(NbProjectManager.java:401)
	at org.netbeans.modules.projectapi.nb.NbProjectManager.access$300(NbProjectManager.java:94)
	at org.netbeans.modules.projectapi.nb.NbProjectManager$2.run(NbProjectManager.java:314)
	at org.netbeans.modules.projectapi.nb.NbProjectManager$2.run(NbProjectManager.java:243)
	at org.netbeans.modules.openide.util.DefaultMutexImplementation.readAccess(DefaultMutexImplementation.java:209)
	at org.openide.util.Mutex.readAccess(Mutex.java:250)
	at org.netbeans.modules.projectapi.nb.NbProjectManager.findProject(NbProjectManager.java:243)
	at org.netbeans.api.project.ProjectManager.findProject(ProjectManager.java:167)
-->	at org.netbeans.api.debugger.jpda.LineBreakpoint$LineBreakpointImpl$LineGroupProperties.getProjects(LineBreakpoint.java:663)
	at org.netbeans.modules.debugger.ui.models.BreakpointGroup.createGroups(BreakpointGroup.java:189)
	at org.netbeans.modules.debugger.ui.models.BreakpointsTreeModel.getChildren(BreakpointsTreeModel.java:126)
	at org.netbeans.spi.viewmodel.Models$DelegatingTreeModel.getChildren(Models.java:1795)
	at org.netbeans.modules.debugger.jpda.ui.models.BreakpointsTreeModelFilter.getChildren(BreakpointsTreeModelFilter.java:117)
	at org.netbeans.spi.viewmodel.Models$CompoundTreeModel.getChildren(Models.java:954)
	at org.netbeans.spi.viewmodel.Models$CompoundModel.getChildren(Models.java:4422)
	at org.netbeans.modules.viewmodel.TreeModelNode$TreeModelChildren.getModelChildren(TreeModelNode.java:1486)
	at org.netbeans.modules.viewmodel.TreeModelNode$TreeModelChildren.run(TreeModelNode.java:1446)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1443)
	at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:68)
	at org.openide.util.lookup.Lookups.executeWith(Lookups.java:303)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2058)