Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 363851 - HTML Generator is not cloning parts
Summary: HTML Generator is not cloning parts
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P1 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-15 12:17 EST by broy2 CLA
Modified: 2017-02-23 14:20 EST (History)
8 users (show)

See Also:


Attachments
Patch for VE problem (1.04 KB, patch)
2011-11-16 16:14 EST, Paul Harmon CLA
lasher: iplog+
Details | Diff
fix to previewirenvironment (1.56 KB, text/plain)
2011-11-17 04:58 EST, Tony Chen CLA
no flags Details
Fix VE environment corruption (3.81 KB, patch)
2011-11-17 14:51 EST, Justin Spadea CLA
lasher: iplog+
Details | Diff
Screen shot of Could not render UI (66.83 KB, image/png)
2011-11-18 10:25 EST, broy2 CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description broy2 CLA 2011-11-15 12:17:13 EST
Import org.eclipse.edt.rui.dojo.samples_0.7.0.
Select GraphSample in dojo.samples and right-click.
Debug As > EGL Rich UI Application.
Get error:
Could not render UI

      ()
      GraphSample.js?contextKey=124:161 ()
      GraphSample.js?contextKey=124:32 ()
      egl.js:801 ()
      GraphSample.html?contextKey=124:80 ([object Array],(function () {egl.localeInfo = {locale: "en_US", nlsCode: "ENU", shortMask: "MM/dd/yyyy", mediumMask: "MM-dd-yyyy", longMask: "MM-dd-yyyy", currencySymbol: "$", decimalSeparator: ".", groupingSeparator: ","};try {egl.handleIDEEvent();egl.rootHandler = new (egl.dojo.samples.GraphSample);if (egl.rootHandler.targetWidget || !egl.rootHandler.egl$isWidget) {egl.rootHandler.setParent(egl.Document);} else {var package = egl.rootHandler.eze$$package;var typename = egl.rootHandler.eze$$typename;egl.rootHandler = egl.Document;egl.rootHandler.eze$$package = package;egl.rootHandler.eze$$typename = typename;}egl.startup();} catch (e) {if (e instanceof egl.egl.debug.DebugTermination) {if (e.msg) {egl.println(e.msg);}} else {egl.crashTerminateSession();if (!egl.dojo.samples.GraphSample) {egl.println("Internal generation error. Found no definition for dojo.samples.GraphSample. Try Project > Clean...", e);} else {egl.printError("Could not render UI", e);throw e;}}}}))
      GraphSample.html?contextKey=124:54 ()
      GraphSample.html?contextKey=124:52 ([object Event])
      GraphSample.html?contextKey=124:40 


egl.dojo.widgets.DojoBubbleChart is not a constructor
[CRRUI2095E] Could not find the EGL function calls leading to this error

    start() at line 161
egl.dojo.widgets.DojoBubbleChart is not a constructor
org.eclipse.edt.rui.dojo.samples_0.7.0/dojo/samples/GraphSample.js?contextKey=124:161
[CRRUI2095E] Could not find the EGL function calls leading to this error
Comment 1 Justin Spadea CLA 2011-11-15 12:58:48 EST
What's happening is IRUtils.getReferencedPartsFor() is not returning the external type references when passing in the IR read off disk. The VE is compiling a new IR and passing that in and it's resolving the external type references. So if using debug, or if you remove the contextKey parameter from the external browser (meaning use saved IR, not live IR), it hits this problem.

Note that the external type references are nested within expressions:

ui.addPortlet(new Portlet { title = "Overview", width = 320, children = [new DojoBubbleChart{

If I add a global field "blah DojoBubbleChart;" then the external type is included in the list and the page loads correctly.
Comment 2 Justin Spadea CLA 2011-11-15 13:01:54 EST
Paul - I reverted your recent change to IRUtils and it still happens, so it's not caused by that change.
Comment 3 Paul Harmon CLA 2011-11-16 16:13:52 EST
I tracked this down to the generation step in the VE. The code was not cloning the part before sending it to the JS generator. Because of this, the part in the environment was getting "corrupted" by the ReorganizeCode class.

I am attaching my patch for this and routing the bug to IDE UI.

Please review the patch and release the change if this change will not have any undesireable side effects in the VE.
Comment 4 Paul Harmon CLA 2011-11-16 16:14:36 EST
Created attachment 207117 [details]
Patch for VE problem
Comment 5 Tony Chen CLA 2011-11-17 04:56:34 EST
I've tested the patch, it worked fine and fixed the problem. 

The question is why is debugger using the preview IR which is supposed to be used only by VE. The problem turn out to be that Egl2Mof.convert() method will try to save the convert result IR. And PreviewIREnvironment inherited the saving behavior from ProjectIREnvironment which finally saves the result to the ProjectIREnvironment's objectStore. 

It means the VE workingcopy's compiling result will always replace the project's IR. This is incorrect and could cause issues in many places (deployment for example). 

I fixed the PreviewIREnvironment so that it only saves to the PreviewObjectStore which is the temp context directory. I have tested the patch together with Paul's patch on RUISample, DojoSample and Mortgage. Things are working as expect. 



(In reply to comment #4)
> Created attachment 207117 [details]
> Patch for VE problem
Comment 6 Tony Chen CLA 2011-11-17 04:58:17 EST
Created attachment 207133 [details]
fix to previewirenvironment
Comment 7 Justin Spadea CLA 2011-11-17 14:51:35 EST
Created attachment 207175 [details]
Fix VE environment corruption

Hi Tony,

Paul and I reviewed your change and found it wasn't complete. Attached is a new patch. There are parts like from Bootstrap.java that need to go into the objectCache, not be ignored. The new patch makes sure that any parts to be cached are only ever cached in the preview store OR objectCache, and never put into one of the other caching object stores.
Comment 8 Justin Spadea CLA 2011-11-17 14:53:29 EST
I've applied Paul's patch and my patch. Heavy VE regression testing should be done next week, in conjunction with the other VE fixes that have gone in recently.
Comment 9 fahua jin CLA 2011-11-17 19:32:48 EST
(In reply to comment #8)
> I've applied Paul's patch and my patch. Heavy VE regression testing should be
> done next week, in conjunction with the other VE fixes that have gone in
> recently.

Justin,

I have big concern for your mentioned 'heavy VE regression testing should be done next week'. We've already finished the VE regression testing, and next week we'll only perform simple green thread testing to make sure no major regression. 

If the fix has big impact on the VE, I vote not to include the fix in 0.7.

Jing, what's you comments?
Comment 10 Tony Chen CLA 2011-11-17 23:39:54 EST
The problem has to be fixed otherwise, unpredictable error can happen in deployment, debugger and maybe more areas that uses IR. We still have a week, we can do a regression of VE instead of just doing simple green thread testing.
Comment 11 Justin Spadea CLA 2011-11-18 08:33:34 EST
Brian had indicated that due to the other recent performance changes made to the VE that it was already going to be regression tested next week. And like Tony said, this is a change we had to make, if we left it alone it can really screw things up elsewhere (like we saw with RUI debug).
Comment 12 broy2 CLA 2011-11-18 10:25:18 EST
Created attachment 207222 [details]
Screen shot of Could not render UI
Comment 13 broy2 CLA 2011-11-18 10:30:44 EST
I'm on the 201111180901 build and still have the problem.
I started with a clean workspace, created a RUI project, and checked out the samples from CVS.
Clicked debug and got: Could not render UI.
Screen shot attached.
Comment 14 Justin Spadea CLA 2011-11-18 12:10:48 EST
I forgot to release the changes, a new build is now available and I've verified it loads correctly in debug.
Comment 15 Jing Qian CLA 2011-11-18 12:12:44 EST
Rocky, the heavy regression has to be done next week. because Tony also had
other 3 performances fixes in the VE area which requires regression tests. 

I think the regression needs to include
   - simple green thread (CRUD application)
   - application development of the complex green thread (popcorn app?)
   - other existing VE regression tests already created in current TTT phase.
Comment 16 broy2 CLA 2011-11-21 17:25:32 EST
Verified in 20111121 build.