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 199458

Summary: Projects libraries are broken due to OpenProjects.getOpenProjects() returning FeatureProjectFactory$FeatureNonProject
Product: projects Reporter: Tomas Zezula <tzezula>
Component: AntAssignee: Tomas Zezula <tzezula>
Status: RESOLVED FIXED    
Severity: normal CC: jtulach
Priority: P3 Keywords: ERGONOMICS
Version: 7.1   
Hardware: PC   
OS: Mac OS X   
Issue Type: DEFECT Exception Reporter:

Description Tomas Zezula 2011-06-16 11:30:15 UTC
Already reported before on the project.libraries, but no way how to reproduce so I've added only logging.
Now I've got to the same situation while running under debugger.
So here is a description:
When creating a new per project library an AE is thrown: Creating library in unknown area: ProjectLibraryArea[/Users/tom/NetBeansProjects/JavaApplication1/lib/nblibraries.properties] known areas: [] created: [] known areas after reinit: [] providers: [ProjectLibraryProvider]

The reason is that the ProjectLibraryProvider.getOpenAreas() asks the OpenProjects.getOpenProjects() for list of projects and the then it tries to get the APH by calling AntBasedProjectFactorySingleton.getHelperFor(p). The AntBasedProjectFactorySingleton.getHelperFor just lookups the APH in WeakHashMap<Project,Reference<APH>>.
While the map is OK and contains mapping J2SEProject to APH the OpenProjects returned no J2SEProject but  FeatureProjectFactory$FeatureNonProject which does not equal to J2SEProject, so no APH is returned.
Also the OpenProjects.getDefault().openProjects().isDone() returns true.
Comment 1 Tomas Zezula 2011-06-16 11:33:55 UTC
Fixed jet-main e80b7588f062
Comment 2 Quality Engineering 2011-06-17 14:40:47 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/e80b7588f062
User: Tomas Zezula <tzezula@netbeans.org>
Log: #199458:Projects libraries are broken due to OpenProjects.getOpenProjects() returning FeatureProjectFactory$FeatureNonProject