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

Bug 348763

Summary: Changing name of flexible record's field not considered structurally different
Product: z_Archived Reporter: Justin Spadea <jspadea>
Component: EDTAssignee: Project Inbox <edt.mofmodel-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: mheitz, pharmon, svihovec
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Justin Spadea CLA 2011-06-08 11:08:26 EDT
record foo
    s string;
end

Rename s to s1, then when the builder invokes TypeUtils.areStructurallyEquivalent() it returns true but it should be false.

1. It's not checking the field names if "if (isValueType(s1)) {" returns false - it only checks type and nullability.

2. Is this check even correct? "if (isValueType(s1)) {" - shouldn't it be checking if f1.getType() is a value type, and not s1?
Comment 1 Paul Harmon CLA 2012-01-17 14:41:48 EST
This must have been fixed at some point, because this is working now.

To answer your second point, it is correct in checking if s1 is a value type. The code is ensuring that the order of the fields in value types (such as records) is structurally significant. The order of fields in reference types (such as ExternalType) are not structurally important. The code checks later on to make sure that a given field has not changed from nullable to non-nullable (or vice vera)
Comment 2 Justin Spadea CLA 2012-02-20 13:55:40 EST
Verified.