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

Bug 345214

Summary: CCE on multi-occurs field access
Product: z_Archived Reporter: Justin Spadea <jspadea>
Component: EDTAssignee: Project Inbox <edt.mofmodel-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: pharmon, svihovec
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Add check for MultiplyOccuringItemTypeBinding lasher: iplog+

Description Justin Spadea CLA 2011-05-09 18:23:41 EDT
Try to compile the following:

program test
	function main()
		rec struct[2];
		a any = rec[1].c.c2;
	end
end

record struct
	10 c char(2)[2];
		20 c2 char(1)[2];
end



Get an exception:
java.lang.ClassCastException: org.eclipse.edt.mof.impl.EClassImpl incompatible with org.eclipse.edt.mof.egl.Type
	at org.eclipse.edt.mof.egl.egl2mof.Egl2MofExpression.visit(Egl2MofExpression.java:274)
	at org.eclipse.edt.mof.egl.egl2mof.Egl2Mof.visit(Egl2Mof.java:1)
	at org.eclipse.edt.compiler.core.ast.FieldAccess.accept(FieldAccess.java:52)
	at org.eclipse.edt.mof.egl.egl2mof.Egl2MofMember.addInitializers(Egl2MofMember.java:639)
	at org.eclipse.edt.mof.egl.egl2mof.Egl2Mof.addInitializers(Egl2Mof.java:1)
	at org.eclipse.edt.mof.egl.egl2mof.Egl2MofStatement.visit(Egl2MofStatement.java:134)
	at org.eclipse.edt.mof.egl.egl2mof.Egl2Mof.visit(Egl2Mof.java:1)
	at org.eclipse.edt.compiler.core.ast.FunctionDataDeclaration.accept(FunctionDataDeclaration.java:76)
	at org.eclipse.edt.mof.egl.egl2mof.Egl2MofPart.handleEndVisitPart(Egl2MofPart.java:414)
	at org.eclipse.edt.mof.egl.egl2mof.Egl2MofPart.defaultHandleVisitPart(Egl2MofPart.java:333)
	at org.eclipse.edt.mof.egl.egl2mof.Egl2MofPart.visit(Egl2MofPart.java:144)
	at org.eclipse.edt.mof.egl.egl2mof.Egl2Mof.visit(Egl2Mof.java:1)
Comment 1 Justin Spadea CLA 2011-07-20 13:40:36 EDT
Created attachment 200029 [details]
Add check for MultiplyOccuringItemTypeBinding

Here's an attempt at a fix. It returns a value similar to array fields, but I don't know this code well enough to be confident in the fix.
Comment 2 Paul Harmon CLA 2011-09-13 14:30:35 EDT
I have fixed this (for now). It will likely require some rework when we support structured records and multi-occurs items in the future.
Comment 3 Justin Spadea CLA 2011-09-13 15:39:37 EDT
Verified