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

Bug 352893

Summary: Compare with enumeration causes a stack trace in the javascript generator
Product: z_Archived Reporter: Joseph Vincens <jvincens>
Component: EDTAssignee: Project Inbox <edt.mofmodel-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: pharmon
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Library that exhibits enumeration problems none

Description Joseph Vincens CLA 2011-07-22 13:16:15 EDT
The following egl expression produces the stack trace below:
		xx Encoding = Encoding.XML;
		if(xx == Encoding.XML)
			writestdout("  ");
		end


Caused by: org.eclipse.edt.mof.egl.NoSuchFunctionError
	at org.eclipse.edt.mof.egl.impl.BinaryExpressionImpl.resolveOperation(BinaryExpressionImpl.java:61)
	at org.eclipse.edt.mof.egl.impl.MultiOperandExpressionImpl.getOperation(MultiOperandExpressionImpl.java:43)
Comment 1 Joseph Vincens CLA 2011-08-02 09:03:07 EDT
Created attachment 200708 [details]
Library that exhibits enumeration problems
Comment 2 Joseph Vincens CLA 2011-08-02 09:13:07 EDT
Can't pass an enumeration as a function parameter. 
IRUtils.makeExprCompatibleToType does 
if (exprType.equals(type) || exprType.getClassifier().equals(type))

exprType.equals(type) calls Enumeration.equals which does this == eglType, which fails because they are not the same object even though this and eglType are the same type Instance of: org.eclipse.edt.mof.egl.Enumeration - eglx._service.Encoding.
Comment 3 Paul Harmon CLA 2011-09-19 12:27:35 EDT
There have been a few improvements with locating the operations when dealing with enums, as well as changes to the makeCompat routine. This seems to be working ok now. The only strange thing I see is that there is a couple of boxing operations happening in the generated java:

		if ((EglAny.ezeBox(xx) == EglAny.ezeBox(Encoding.XML))) {
		}


These do not appear to cause any problems though.
Comment 4 Joseph Vincens CLA 2011-10-03 08:56:19 EDT
verified