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 215127

Summary: consider removing usage of MavenProject.getParent()
Product: projects Reporter: Milos Kleint <mkleint>
Component: MavenAssignee: Milos Kleint <mkleint>
Status: RESOLVED FIXED    
Severity: normal Keywords: PERFORMANCE
Priority: P3    
Version: 7.3   
Hardware: PC   
OS: Windows 7   
Issue Type: TASK Exception Reporter:

Description Milos Kleint 2012-07-03 12:51:08 UTC
try delegating to existing Mavenproject from cache or use some other means yet unknown.

The MavenProjects from getParent are incomplete, are calculated on demand and stick there forever occupying memory
Comment 1 Milos Kleint 2012-07-09 11:34:00 UTC
http://hg.netbeans.org/core-main/rev/ec35eae2bb89

MavenProject.getParent() replaced by NbMavenProjectImpl.loadParentOf() which reuses the configuration from current project and loads the parent (of parent,...)

Some instances that called getParent() but used only trivial values from the result now use the MavenEmbedder.getModelDescriptors() call which returns data collected while loading the MavenProject
Comment 2 Milos Kleint 2012-07-09 11:36:55 UTC
because of fix of issue 215159, the attempt to call MavenProject.getParent()  will result in thrown exception
Comment 3 Quality Engineering 2012-07-11 03:28:55 UTC
Integrated into 'main-golden', will be available in build *201207110002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/ec35eae2bb89
User: Milos Kleint <mkleint@netbeans.org>
Log: #215159, #215127 clear projectBuildingRequest from Mavenproject instance which seems to b the point effectively referencing a RepositoryCache holding multiple Model object.
Get rid of calls to MavenProject.getParent() and replace it with a method more suited for sparse invokations with throwaway results.
Introduce ModelDescription to MavenEmbedder that contains various information collected while loading project's MavenProject, allowing to reduce the number of repeated queries to the embedder environment.