Bug 128247 - Initialized field variable with no properties set causes parse error
Summary: Initialized field variable with no properties set causes parse error
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: VE (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Srimanth CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-16 11:49 EST by Richard Kulp CLA
Modified: 2011-06-13 11:37 EDT (History)
1 user (show)

See Also:


Attachments
Simple test case (789 bytes, text/x-java)
2006-02-16 11:50 EST, Richard Kulp CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Kulp CLA 2006-02-16 11:49:15 EST
If you have an initialized field variable and it is used, but no properties are set on it, you get a parse error and no visuals. 

This is because it is not assigned to any initialize method, so it throws an NPE somewhere.
Comment 1 Richard Kulp CLA 2006-02-16 11:50:40 EST
Created attachment 34853 [details]
Simple test case
Comment 2 Richard Kulp CLA 2006-02-16 13:21:01 EST
By the way the workaround for this is to change from:

	final Shell popupShell = new Shell(sShell);
	
	/**
	 * This method initializes sShell
	 */
	private void createSShell() {
		sShell = new Shell();
		sShell.setText("Shell");


to:

	Shell popupShell;
	
	/**
	 * This method initializes sShell
	 */
	private void createSShell() {
		sShell = new Shell();
		popupShell = new Shell(sShell);
		sShell.setText("Shell");