Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 363558 - Mortgage sample main handler can not open
Summary: Mortgage sample main handler can not open
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P1 major (vote)
Target Milestone: ---   Edit
Assignee: Huang Ji Yong CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-11 03:19 EST by Tony Chen CLA
Modified: 2017-02-23 14:14 EST (History)
2 users (show)

See Also:


Attachments
completed mortgage sample (1.27 MB, application/x-zip-compressed)
2011-11-11 03:19 EST, Tony Chen CLA
no flags Details
A temporary patch, need Jeff's review (1.20 KB, patch)
2011-11-12 05:26 EST, Huang Ji Yong CLA
lasher: iplog+
Details | Diff
A simple test case (10.23 KB, patch)
2011-11-12 06:55 EST, Huang Ji Yong CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tony Chen CLA 2011-11-11 03:19:17 EST
Created attachment 206827 [details]
completed mortgage sample
Comment 1 Tony Chen CLA 2011-11-11 03:20:17 EST
Open the main handler, it shows runtime exception saying ui can not be initialized. This used to be working fine before Now 10.
Comment 2 Huang Ji Yong CLA 2011-11-12 05:26:19 EST
Created attachment 206891 [details]
A temporary patch, need Jeff's review
Comment 3 Huang Ji Yong CLA 2011-11-12 06:55:53 EST
Created attachment 206892 [details]
A simple test case

This problem happens when a function in a handler references a field in another handler.
In this sample, wheatherlib.egl accessed weatherTable.xml
Steps to reproduce
1. comment out // xml string = "da"; in WeatherTable.egl and save. The js will be regenerated and weatherlib.egl should have compile error.
2. uncomment  xml string = "da";  The weatherTable.egl and weatherlib.egl will be regenerated.
Look at the generated js in weathertable.js 
"eze$$setInitial": function() {
	this.eze$$setEmpty();
	this.xml = "da";
	this.weatherData = [eze$Temp2].setType("[Teu/weatherdata;"); //This line is wrong
}

This error happens because the weatherTable is reorganized when weatherlib is generated. We should prevent the reorganization of field of other handlers.
Comment 4 Jeff Douglas CLA 2011-11-14 07:35:40 EST
I cannot tell if that would break everything or not, but it looks dangerous to me because it will stop the flow of the IR accepts.

I will need time to see and try your testcase
Comment 5 Jeff Douglas CLA 2011-11-14 07:59:45 EST
I cannot get to that testcase. Please post the EGL source in a format that I can use.
Comment 6 Huang Ji Yong CLA 2011-11-14 20:16:20 EST
Hi Jeff,
This is the source code of the 2 handlers in the test case.
weatherlib.egl:

package eu;

library weatherlib
	
    function hello()    	
    	syslib.writeStderr(WeatherTable.xml);
    	syslib.writeStdout(WeatherTable.weatherData.getSize());
    end
end


record WeatherData{}
    Day string?;
end


WeatherTable.egl:
package eu;

library WeatherTable
    xml string = "da";

    weatherData WeatherData[] =[
   		new WeatherData{Day = "Tuesday, June 02, 2009"}];
end

Please create a web client project to include this two handlers and follow the steps in comment 3 to recreate the problem.
Thanks
Comment 7 Jeff Douglas CLA 2011-11-15 09:06:04 EST
It looks like you did a very good job on figuring this out and it corrects the same problem for both javaGen and JSGen. Thank you, well done! I've committed the update.
Comment 8 Tony Chen CLA 2011-11-18 09:05:31 EST
Verified. Problem does not exist for Mortgage now.