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 81428 - Code generated into guarded block generate runtime NPE
Summary: Code generated into guarded block generate runtime NPE
Status: RESOLVED INVALID
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Code (show other bugs)
Version: 5.x
Hardware: All All
: P1 blocker (vote)
Assignee: issues@guibuilder
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-07-30 02:26 UTC by Chris Webster
Modified: 2006-07-31 09:36 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Webster 2006-07-30 02:26:11 UTC
Steps to reproduce:

1. Open the netbeans module from 
xml/schema/schemaui (this is in release55 branch). 

2. open
org.netbeans.modules.xml.schema.ui.retriever.RetrieveXmlResourceWizardVisualPanel1
notice that the guarded block code around line 90 has all the initializations first

3. Now change a property in the form design view. I changed the font and then
restored to the original, I think it will occur anytime the guarded block is
regenerated. Now notice that around line 93 you will see 
 lfsSourceFileLocationTextField.setText(null); 
This statement is before the initialization of the member variable and causes an
 NPE at runtime.
Comment 1 Tomas Pavek 2006-07-31 09:36:18 UTC
In this form, URLFileLocationTextField component has Post-Creation code set to:
lfsSourceFileLocationTextField.setText(null);

That's why it is generated into code. Not sure how it happened it was not
presenet in the .java file.


BTW note that closureCheckBox.toolTipText in this form refers to wrong bundle
(probably result of package rename):
org/netbeans/modules/xml/project/ui/wizards/retriever/Bundle.properties
which should be:
org/netbeans/modules/xml/schema/ui/retriever/Bundle.properties