Bug 308351 - ClassCastException in ModelContentPreviewViewer when pressing back button
Summary: ClassCastException in ModelContentPreviewViewer when pressing back button
Status: CLOSED FIXED
Alias: None
Product: EMFCompare
Classification: Modeling
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: EMF Compare CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2010-04-07 11:41 EDT by Jan Reimann CLA
Modified: 2013-04-24 07:22 EDT (History)
1 user (show)

See Also:


Attachments
patch containing an instanceof check (1.68 KB, patch)
2010-04-07 11:43 EDT, Jan Reimann CLA
laurent.goubet: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Reimann CLA 2010-04-07 11:41:33 EDT
Build Identifier: M20090917-0800

If somebody wants to extend the ltk refactoring functionality by providing a compare view of models, then the own Change extension needs only to implement IModelCompareInputProvider and the preview page of the refactoring displays a ModelContentPreviewViewer. As input a IModelCompareInputProvider will be expected. But when the preview is open and one presses the back button, a NullChange object will be created. This object is not implementing IModelCompareInputProvider and that's why the setInput(ChangePreviewViewerInput in) method in the ModelContentPreviewViewer cannot cast the NullChange object to IModelCompareInputProvider. This exception is swallowed anyhow and the user only wonders about why the previous page is being displayed but with the control of the compare viewer. An instanceof check is needed at this place.

Reproducible: Always
Comment 1 Jan Reimann CLA 2010-04-07 11:43:01 EDT
Created attachment 164081 [details]
patch containing an instanceof check

here is a patch with an instanceof check
Comment 2 Laurent Goubet CLA 2010-04-08 03:40:11 EDT
Thanks for the feedback ; the ModelContentPreviewViewer was a contribution from Moritz Eysholdt and I admit it hasn't been tested thoroughly. You patch has been contributed as is on CVS HEAD and will be available in M7