Bug 308306 - Comparing textual representations of models returns null as IContentDescription
Summary: Comparing textual representations of models returns null as IContentDescription
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 05:26 EDT by Jan Reimann CLA
Modified: 2013-04-24 07:21 EDT (History)
1 user (show)

See Also:


Attachments
null check patch for EclipseModelUtils (1.47 KB, patch)
2010-04-07 05:27 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 05:26:34 EDT
Build Identifier: M20090917-0800

I try to compare two evolution steps of the same model. This model is available as textual representation (EMFText). When calling doContentMatch of the MatchService, internally getCommonContentType from EclipseModelUtils will be invoked. I guess, because of being a textual representation of the model, ResourcesPlugin.getWorkspace().getRoot().getFile(modelPath).getContentDescription() returns null and that's why a NPE is thrown. Some null checks are needed.

Reproducible: Always

Steps to Reproduce:
Happens every time I try to compare two models whose URIs point to a textual representation.
Comment 1 Jan Reimann CLA 2010-04-07 05:27:58 EDT
Created attachment 164019 [details]
null check patch for EclipseModelUtils

I added two null checks in the method EclipseModelUtilsgetCommonContentType(URI... uris)
Comment 2 Laurent Goubet CLA 2010-04-07 05:42:42 EDT
Thanks, the fix for this will be accessible in M7.