Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 361493 - The initialization code for widget created by "new" is duplicate
Summary: The initialization code for widget created by "new" is duplicate
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P1 normal (vote)
Target Milestone: ---   Edit
Assignee: Yun Feng Ma CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-20 01:17 EDT by Huang Ji Yong CLA
Modified: 2017-02-23 14:14 EST (History)
2 users (show)

See Also:


Attachments
test case (999 bytes, application/octet-stream)
2011-10-20 01:27 EDT, Huang Ji Yong CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Huang Ji Yong CLA 2011-10-20 01:17:02 EDT
Open the attached egl file. The code for a new DojoContentPane is generated twice.
var eze$Temp2 = null;
{
	var eze$SettingTarget1 = new egl.dojo.widgets.DojoContentPane();
	egl.atLine(this.eze$$fileName,20,600,53, this);
	eze$SettingTarget1 = new egl.dojo.widgets.DojoContentPane();
	egl.setWidgetLocation(eze$SettingTarget1, 'eze$SettingTarget1', 600, 53, true);
}
Comment 1 Huang Ji Yong CLA 2011-10-20 01:27:32 EDT
Created attachment 205576 [details]
test case
Comment 2 Scott Greer CLA 2011-10-31 10:06:59 EDT
This isn't specific to widgets.  Somewhat recently, Java gen fixed this by adding logic to decide when it could emit a single line to cover the declaration and initialization for a given field.   This is contained in DeclarationExpressionTemplate and FieldTemplate (and possibly other places), so this logic needs to be "ported" over to the JS gen templates.   Check with Jeff if there are questions about this.
Comment 3 Yun Feng Ma CLA 2011-11-17 11:01:59 EST
Fixed, borrowed JavaGen logic. Thanks.
Comment 4 Huang Ji Yong CLA 2011-11-23 03:00:21 EST
Verified in build 201111210901