Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 355091 - TypeUtils.isValueType doesn't work when a generator passes in a record
Summary: TypeUtils.isValueType doesn't work when a generator passes in a record
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P1 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-18 10:16 EDT by Joseph Vincens CLA
Modified: 2017-02-23 14:20 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Vincens CLA 2011-08-18 10:16:56 EDT
In Java gen I passed a record into this method and it didn't find the record as a value type. I can't give you a testcase because I rewrote the generator. I found the problem was in 
((EGLClass)type.getClassifier()).isSubtypeOf((EGLClass)getType(Type_AnyValue)). getType goes to the environment and gets AnyValue and goes into StructPart.isSubtypeOf, as the method iterates through the supertypes of record it gets to AnyValue this is not the same instance as the AnyAvlue object from the environment, so the == fails.
			for (StructPart superType : getSuperTypes()) {
				if (superType == part) {
					return true;
				}
			}
Comment 1 Joseph Vincens CLA 2011-09-15 13:40:46 EDT
This happened because I had the EGL system part AnyValue file in my workspace because I was generating the system parts. This caused a 2nd set of irs to be created. So when a new record was created it uses a different ir that the 1 in the eglar, so the == fails. 
I spoke with Tim and if EGLAny or AnyValue is in the workspace bad things will happen because these are the base for most of our types. 
Maybe the solution is to document not to do this.
Comment 2 Paul Harmon CLA 2011-10-25 11:54:26 EDT
Saul,

We should document that the users should not use packages that collide with our system packages. Doing so could confuse our environment and cause confusing/unpredictable results.

Please let me know if you need a list of all of our system packages.

Paul
Comment 3 Ben Margolis CLA 2011-11-21 11:19:46 EST
is in place here:

http://wiki.eclipse.org/EDT:Language_Overview03

can this bug report be closed now?