Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 326032 - BasicChangeRecorder.getFeatureChange(..) casts the List to EObjectContainmentEList which causes ClassCastException
Summary: BasicChangeRecorder.getFeatureChange(..) casts the List to EObjectContainment...
Status: CLOSED FIXED
Alias: None
Product: EMF
Classification: Modeling
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: Macintosh Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Ed Merks CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-23 06:54 EDT by Thanapol R. CLA
Modified: 2010-12-14 23:29 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thanapol R. CLA 2010-09-23 06:54:09 EDT
Build Identifier: 20100617-1415

library: org.eclipse.emf.ecore.change_2.5.0.v20100521-1846.jar
package: org.eclipse.emf.ecore.change.util
class: BasicChangeRecorder
method:   protected FeatureChange getFeatureChange(List<FeatureChange> featureChanges, EStructuralFeature eStructuralFeature)
line: 243
--------------------
EObjectContainmentEList<FeatureChange> changes = (EObjectContainmentEList<FeatureChange>)featureChanges;
--------------------

It casts the "List<FeatureChagne"> to "EObjectContainmentEList<FeatureChange>", but there is no code which need to use the EObjectContainmentEList.
It is not necessary to do this casting.

Reproducible: Always

Steps to Reproduce:
1. Create some ecore model that has a containment reference.
2. Generate the code
3. By default, it will create the containment reference list using EObjectContainmentEList. 
4. Try to create this list with other List type, which is not inherit from EObjectContainmentEList.
5. Try to change value of this list. The BasicChangeRecorder.getFeatureChange(..) will be called.
Comment 1 Ed Merks CLA 2010-09-23 07:01:22 EDT
The fix is committed to CVS for 2.7.
Comment 2 Ed Merks CLA 2010-11-05 05:44:38 EDT
The fix is available in the latest build for the stream.
Comment 3 Ed Merks CLA 2010-12-13 16:42:44 EST
The fixes are available in a published build.
Comment 4 Ed Merks CLA 2010-12-14 23:28:06 EST
Try again to resolve as fixed (and available in a build).
Comment 5 Ed Merks CLA 2010-12-14 23:29:43 EST
Oh, I guess I have to close them!