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 115633 - Opening/Creating a custom project type throws an NPE
Summary: Opening/Creating a custom project type throws an NPE
Status: VERIFIED FIXED
Alias: None
Product: profiler
Classification: Unclassified
Component: Base (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: J Bachorik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-09-15 09:45 UTC by Rohan Ranade
Modified: 2007-10-09 09:36 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Module NBMs to reproduce the scenario. Install modules and create new Provisioning/Basic Project (2.27 MB, application/octet-stream)
2007-09-15 09:48 UTC, Rohan Ranade
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rohan Ranade 2007-09-15 09:45:15 UTC
When creating a new project instance of my custom project type in NetBeans 6.0 (NBMs attached), NetBeans throws an NPE.
The stack trace is given below. It seems to be a problem in the Profiler's ProjectUtilities class. Disabling the
profiler module removes these exceptions. The same code used to work fine in NetBeans 5.5.1.

java.lang.NullPointerException
       at org.netbeans.modules.profiler.utils.ProjectUtilities.hasAction(ProjectUtilities.java:323)
       at org.netbeans.modules.profiler.utils.ProjectUtilities.isProjectTypeSupported(ProjectUtilities.java:318)
       at org.netbeans.modules.profiler.actions.AntActions$6.enable(AntActions.java:299)
       at org.netbeans.modules.project.ui.actions.MainProjectAction.refreshView(MainProjectAction.java:132)
       at org.netbeans.modules.project.ui.actions.MainProjectAction.access$000(MainProjectAction.java:51)
       at org.netbeans.modules.project.ui.actions.MainProjectAction$1.run(MainProjectAction.java:120)
       at org.openide.util.Mutex.doEvent(Mutex.java:1181)
       at org.openide.util.Mutex.readAccess(Mutex.java:287)
       at org.netbeans.modules.project.ui.actions.MainProjectAction.propertyChange(MainProjectAction.java:118)
       at org.openide.util.WeakListenerImpl$PropertyChange.propertyChange(WeakListenerImpl.java:164)
       at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:339)
       at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:276)
       at org.netbeans.modules.project.ui.OpenProjectList.setMainProject(OpenProjectList.java:488)
       at org.netbeans.modules.project.ui.actions.NewProject$2.run(NewProject.java:190)
       at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
       at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
[catch] at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
       at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
       at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
       at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
       at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
       at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
Comment 1 Rohan Ranade 2007-09-15 09:48:09 UTC
Created attachment 48880 [details]
Module NBMs to reproduce the scenario. Install modules and create new Provisioning/Basic Project
Comment 2 Rohan Ranade 2007-09-15 09:52:50 UTC
Lookup contents of the Project:

private Lookup createLookup(AuxiliaryConfiguration aux) {
        return Lookups.fixed(new Object[]{
            new Info(), // ProjectInformation
            aux, 
            helper.createCacheDirectoryProvider(), 
            new ProjectXmlSavedHookImpl(), 
            new ProjectOpenedHookImpl(), 
            new BasicProjectSources(this.helper, evaluator(), getComponentRoots(), getPlanRoots(), null), 
            new RecommendedTemplatesImpl(), 
            new BasicProjectLogicalViewProvider(this, this.helper, evaluator()), 
            metaProvider, 
            this});
    }
Comment 3 Milan Kubec 2007-09-17 11:23:27 UTC
Please evaluate, thanks.
Comment 4 J Bachorik 2007-09-17 12:48:46 UTC
this was caused by the lack of check for NP when calling operations on a lookup result
it is now fixed
Comment 5 Alexander Kouznetsov 2007-10-09 09:36:33 UTC
Verified with 200710071200