Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 358526

Summary: compiler wrong to compile org.eclipse.edt.rui.mvc.FormField to org.eclipse.edt.mof.egl.FormField
Product: z_Archived Reporter: Huo Zhen Zhong <huozz>
Component: EDTAssignee: Huo Zhen Zhong <huozz>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: chenzhh, pharmon, svihovec
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Huo Zhen Zhong CLA 2011-09-22 03:52:58 EDT
Build Identifier: 2011-09-22

Step to recreate:
1. new a RUI handler
2. new a string variable in the handler
3. in the data view, dnd the string variable onto VE
4. select "Editable Data" in the dnd wizard and finish
5. some code generated, and compile error showed in handleValidStateChange function, compile exceptions also shown as below.

I did a investigation, and found that it is caused that the compiler wrong to compile org.eclipse.edt.rui.mvc.FormField to org.eclipse.edt.mof.egl.FormField.

You can set a debug point in 61 line (List contents = ((Handler)result.getBoundPart()).getContents();) of org.eclipse.edt.ide.rui.document.utils.TypeNameResolver to see that, after compiler, in the memory, it shows the contents comtents org.eclipse.edt.rui.mvc.FormField instead of org.eclipse.edt.mof.egl.FormField


org.eclipse.edt.compiler.internal.core.builder.BuildException: java.lang.ClassCastException: org.eclipse.edt.mof.impl.EClassImpl incompatible with org.eclipse.edt.mof.egl.Type
	at org.eclipse.edt.compiler.internal.core.builder.AbstractProcessingQueue.process(AbstractProcessingQueue.java:187)
	at org.eclipse.edt.compiler.internal.core.builder.AbstractProcessingQueue.process(AbstractProcessingQueue.java:152)
	at org.eclipse.edt.ide.core.internal.builder.AbstractBuilder.processParts(AbstractBuilder.java:99)
	at org.eclipse.edt.ide.core.internal.builder.AbstractBuilder.build(AbstractBuilder.java:136)
	at org.eclipse.edt.ide.core.internal.builder.Builder.cleanBuild(Builder.java:167)
	at org.eclipse.edt.ide.core.internal.builder.Builder.build(Builder.java:94)
	at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:629)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:172)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:203)
	at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:255)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:258)
	at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:311)
	at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:343)
	at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:144)
	at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:242)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Caused by: java.lang.ClassCastException: org.eclipse.edt.mof.impl.EClassImpl incompatible with org.eclipse.edt.mof.egl.Type
	at org.eclipse.edt.compiler.internal.egl2mof.Egl2MofStatement.visit(Egl2MofStatement.java:130)
	at org.eclipse.edt.compiler.internal.egl2mof.Egl2Mof.visit(Egl2Mof.java:1)
	at org.eclipse.edt.compiler.core.ast.FunctionDataDeclaration.accept(FunctionDataDeclaration.java:76)
	at org.eclipse.edt.compiler.internal.egl2mof.Egl2MofStatement.visit(Egl2MofStatement.java:429)
	at org.eclipse.edt.compiler.internal.egl2mof.Egl2Mof.visit(Egl2Mof.java:1)
	at org.eclipse.edt.compiler.core.ast.ForStatement.accept(ForStatement.java:163)
	at org.eclipse.edt.compiler.internal.egl2mof.Egl2MofPart.handleEndVisitPart(Egl2MofPart.java:521)
	at org.eclipse.edt.compiler.internal.egl2mof.Egl2MofPart.defaultHandleVisitPart(Egl2MofPart.java:386)
	at org.eclipse.edt.compiler.internal.egl2mof.Egl2MofPart.visit(Egl2MofPart.java:199)
	at org.eclipse.edt.compiler.internal.egl2mof.Egl2Mof.visit(Egl2Mof.java:1)
	at org.eclipse.edt.compiler.core.ast.Handler.accept(Handler.java:55)
	at org.eclipse.edt.compiler.internal.egl2mof.Egl2Mof.convert(Egl2Mof.java:160)
	at org.eclipse.edt.ide.core.internal.builder.AbstractProcessingQueue.createIRFromBoundAST(AbstractProcessingQueue.java:245)
	at org.eclipse.edt.ide.core.internal.builder.AbstractProcessingQueue.processCompiledPart(AbstractProcessingQueue.java:221)
	at org.eclipse.edt.ide.core.internal.builder.AbstractProcessingQueue.level03Compile(AbstractProcessingQueue.java:164)
	at org.eclipse.edt.compiler.internal.core.builder.AbstractProcessingQueue.process(AbstractProcessingQueue.java:169)
	... 17 more

Reproducible: Always
Comment 1 Paul Harmon CLA 2011-09-23 08:23:17 EDT
I have added code to prevent the class cast exceptions in the EGL2Mof code. However, the root of the problem is that the VE code is not adding an import statement for the org.eclipse.edt.rui.mvc.FormField. Because of this, the environment is resolving to the FormField that is defined in the mof model.

I am rerouting this defect to EDT IDE, since a change needs to be made to the VE.
Comment 2 Brian Svihovec CLA 2011-09-23 14:58:30 EDT
Lowering the severity since this is now just an organize imports bug.
Comment 3 Huo Zhen Zhong CLA 2011-10-08 01:24:47 EDT
fixed in 358359
Comment 4 Huo Zhen Zhong CLA 2011-10-19 23:27:58 EDT
verified in 0.7.0.v20111019