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 47628 - NPE from New action in popup menu on project
Summary: NPE from New action in popup menu on project
Status: CLOSED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Project (show other bugs)
Version: 4.x
Hardware: All All
: P1 blocker (vote)
Assignee: Tomas Zezula
URL:
Keywords: REGRESSION
: 47595 47687 47864 (view as bug list)
Depends on:
Blocks: 41535 47824
  Show dependency tree
 
Reported: 2004-08-21 09:43 UTC by Pavel Buzek
Modified: 2006-03-24 09:40 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
NPE (3.46 KB, text/plain)
2004-08-21 09:44 UTC, Pavel Buzek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pavel Buzek 2004-08-21 09:43:02 UTC
Trunk build, new userdir. Create a project and
invoke New > Java Class from popup menu. You get
an NPE. The same for other types of files.

I am marking as P1 since this is very visible and
easy to fix, although a workaround exists (using
Ctrl-N instead of popup menu works for me).

It is caused by a recent commit:

tzezula@netbeans.org wrote:
> , TemplateChooserPanel.java
> , TemplateChooserPanelGUI.java ...
> 
>   User: tzezula 
>   Date: 04/08/20 09:03:26
> 
>   Modified:   
projectui/src/org/netbeans/modules/project/ui
>                         TemplateChooserPanel.java
>                        
TemplateChooserPanelGUI.java TemplatesPanelGUI.java
>   Log:
>   Improved preselection in the new file wizard.
>   

when I get the version of these file before it
works for me
Comment 1 Pavel Buzek 2004-08-21 09:44:21 UTC
Created attachment 17009 [details]
NPE
Comment 2 Jesse Glick 2004-08-21 17:58:04 UTC
Looks like the wizard has already been uninitialized when current() is
called during instantiate()? A bug in TemplateWizard perhaps?

Only applies to NJFWI, not to non-Java files.
Comment 3 Petr Hrebejk 2004-08-23 09:53:01 UTC
*** Issue 47595 has been marked as a duplicate of this issue. ***
Comment 4 Tomas Zezula 2004-08-23 10:25:57 UTC
The issues has nothing in common with commit mentioned above by Pavel.
The problem is that current is called even after uninitialized is
called. Seems a bug in the wizards framework.
Comment 5 Marian Mirilovic 2004-08-23 12:02:35 UTC
*** Issue 47687 has been marked as a duplicate of this issue. ***
Comment 6 Tomas Zezula 2004-08-23 12:39:29 UTC
Checking in
projectui/src/org/netbeans/modules/project/ui/TemplateChooserPanelGUI.java;
/cvs/projects/projectui/src/org/netbeans/modules/project/ui/TemplateChooserPanelGUI.java,v
 <--  TemplateChooserPanelGUI.java
new revision: 1.29; previous revision: 1.28
done

Pavel was right, the NPE was caused by other exception which was not
notified by the ErrorManager but was catched by TemplateWizard and
printed to console this exception was thrown from initialize and
causes the panels to be null.
Comment 7 Jiri Rechtacek 2004-08-26 15:27:26 UTC
*** Issue 47864 has been marked as a duplicate of this issue. ***
Comment 8 Jaromir Uhrik 2006-01-19 09:32:14 UTC
Verified.