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

Bug 314519

Summary: CDOView.getObject(T) causes ClassCastException with legacy objects
Product: [Modeling] EMF Reporter: Eike Stepper <stepper>
Component: cdo.legacyAssignee: Eike Stepper <stepper>
Status: CLOSED FIXED QA Contact: Eike Stepper <stepper>
Severity: normal    
Priority: P3 CC: martin.fluegge
Version: 3.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Patch none

Description Eike Stepper CLA 2010-05-26 12:53:51 EDT
The return value should go through CDOUtil.getEObject() because CDOLegacyAdapter can not be cast to T normally.
Comment 1 Eike Stepper CLA 2010-05-26 12:59:10 EDT
Created attachment 170052 [details]
Patch

For future reference
Comment 2 Eike Stepper CLA 2010-05-26 13:00:11 EDT
Changed to:

      CDOID id = object.cdoID();
      InternalCDOObject contextified = getObject(id, true);

      @SuppressWarnings("unchecked")
      T cast = (T)CDOUtil.getEObject(contextified);
      return cast;
Comment 3 Eike Stepper CLA 2010-06-29 04:36:30 EDT
Available in 3.0 GA:
http://download.eclipse.org/modeling/emf/cdo/updates/3.0-releases/