Bug 215127 - consider removing usage of MavenProject.getParent()
Summary: consider removing usage of MavenProject.getParent()
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 7.3
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Milos Kleint
Depends on:
Reported: 2012-07-03 12:51 UTC by Milos Kleint
Modified: 2013-01-15 11:23 UTC (History)
0 users

See Also:
Issue Type: TASK
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
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

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.