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

Summary: Code generated into guarded block generate runtime NPE
Product: guibuilder Reporter: Chris Webster <cwebster>
Component: CodeAssignee: issues@guibuilder <issues>
Status: RESOLVED INVALID    
Severity: blocker    
Priority: P1    
Version: 5.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

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