Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [EMF Compare] Compare editor return a text compare and not a model compare
[EMF Compare] Compare editor return a text compare and not a model compare [message #1014921] Tue, 26 February 2013 19:41 Go to next message
Jacques Bouthillier is currently offline Jacques BouthillierFriend
Messages: 5
Registered: May 2011
Junior Member
I try to open a model with EMF compare 2.1 . I followed the instruction in the user guide. An eclipse compare editor opens but It generates the error below.

When the compare editor opens, it only gives me the choice to see the compare as text , not as a model compare.
I use GIT as a version control. I created a URIHandler to read the content of the model file. The file extensions are (*.ecore or *.ecorediag). As a text compare the result is appropriate.

I also tried to open a model (*.ecorediag) from the package explorer which is also under git and tried to compare with the previous version. This time it is completely outside of the code I wrote, I only get an eclipse compare as text, not an emf compare model.

Error:

!ENTRY org.eclipse.gmf.runtime.diagram.ui 4 2 2013-02-26 13:56:34.184
!MESSAGE IRJS0007E Semantic refresh failed.
!STACK 0
java.lang.ClassCastException: org.eclipse.gmf.runtime.notation.impl.DiagramImpl cannot be cast to org.eclipse.emf.ecore.EPackage
at org.eclipse.emf.ecoretools.diagram.part.EcoreDiagramUpdater.getEPackage_79SemanticChildren(EcoreDiagramUpdater.java:311)
at org.eclipse.emf.ecoretools.diagram.edit.policies.EPackageCanonicalEditPolicy.getSemanticChildrenList(EPackageCanonicalEditPolicy.java:73)
at org.eclipse.emf.ecoretools.diagram.edit.policies.EPackageCanonicalEditPolicy.deleteOrphanedViews(EPackageCanonicalEditPolicy.java:180)
at org.eclipse.emf.ecoretools.diagram.edit.policies.EPackageCanonicalEditPolicy.refreshSemantic(EPackageCanonicalEditPolicy.java:159)
at org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy.refresh(CanonicalEditPolicy.java:961)
at org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalConnectionEditPolicy.refreshOnActivate(CanonicalConnectionEditPolicy.java:107)
at org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy.activate(CanonicalEditPolicy.java:628)
at org.eclipse.gef.editparts.AbstractEditPart.activateEditPolicies(AbstractEditPart.java:174)
at org.eclipse.gef.editparts.AbstractEditPart.activate(AbstractEditPart.java:156)
at org.eclipse.gef.editparts.AbstractGraphicalEditPart.activate(AbstractGraphicalEditPart.java:195)
at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart.access$0(GraphicalEditPart.java:1)
at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart.activate(GraphicalEditPart.java:205)
at org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart.activate(DiagramEditPart.java:349)
at org.eclipse.gef.editparts.AbstractEditPart.addChild(AbstractEditPart.java:215)
at org.eclipse.gef.editparts.SimpleRootEditPart.setContents(SimpleRootEditPart.java:105)
at org.eclipse.gef.ui.parts.AbstractEditPartViewer.setContents(AbstractEditPartViewer.java:617)
at org.eclipse.gmf.runtime.diagram.ui.parts.DiagramGraphicalViewer.setContents(DiagramGraphicalViewer.java:352)
at org.eclipse.gef.ui.parts.AbstractEditPartViewer.setContents(AbstractEditPartViewer.java:626)
at org.eclipse.gmf.runtime.diagram.ui.OffscreenEditPartFactory.createDiagramEditPart(OffscreenEditPartFactory.java:128)
at org.eclipse.gmf.runtime.diagram.ui.OffscreenEditPartFactory.createDiagramEditPart(OffscreenEditPartFactory.java:77)
at org.eclipse.emf.compare.diagram.diff.util.GMFLabelUtil$AbstractLabelHandling.run(GMFLabelUtil.java:196)
at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:180)
at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:150)
at org.eclipse.swt.widgets.Display.syncExec(Display.java:4687)
at org.eclipse.emf.compare.diagram.diff.util.GMFLabelUtil.getTextEditPart(GMFLabelUtil.java:65)
at org.eclipse.emf.compare.diagram.provider.AbstractLabelProvider.elementLabel(AbstractLabelProvider.java:38)
at org.eclipse.emf.compare.diagram.ide.diff.DiagramDiffIDEExtensionPostProcessor.computeLabels(DiagramDiffIDEExtensionPostProcessor.java:92)
at org.eclipse.emf.compare.diagram.ide.diff.DiagramDiffIDEExtensionPostProcessor.postRequirements(DiagramDiffIDEExtensionPostProcessor.java:50)
at org.eclipse.emf.compare.EMFCompare.compare(EMFCompare.java:193)

Thanks,
Jacques
Re: [EMF Compare] Compare editor return a text compare and not a model compare [message #1015018 is a reply to message #1014921] Wed, 27 February 2013 08:25 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1900
Registered: July 2009
Senior Member
Jacques,

This is an error that occurs in a part of the code that's due for deletion (we're removing the detection of "label" changes because of the way we have to do it... see more details on http://eclipsemde.blogspot.fr/2013/02/emf-and-graphical-comparison-whats-in.html). However, we never experienced such a critical failure.

Can you reproduce this with any ecorediag file? If not, could you provide us with a sample that does fail?

Laurent Goubet
Obeo
Re: [EMF Compare] Compare editor return a text compare and not a model compare [message #1015144 is a reply to message #1015018] Wed, 27 February 2013 15:11 Go to previous messageGo to next message
Jacques Bouthillier is currently offline Jacques BouthillierFriend
Messages: 5
Registered: May 2011
Junior Member
Hi Laurent,

Note: this is not the only model I get the error.(ClassCastException)

The code to test is available from github
1- The model code I used to test is :
Remote Fetch URL github.com/lmcalvs/modelSamples.git
I used the model/ExtendedPO.ecorediag

If you try to compare the ExtendedPO.ecorediag with the previous version, Only the text compare will show, not the EMF compare as a model GUI, but the diff can be seen if you select text compare

2- The code from R4E is available on github as well:
Remote Fetch URL github.com:lmcalvs/r4e_reviews.git
The branch is: emf_compare_merge_2.1
Target platform used: r4e-emf-compare_2.1_eclipse3.8_mylyn3.9

3- To use R4E
Instruction on user guide:
http://wiki.eclipse.org/Reviews/R4E/User_Guide
Since the R4E code is in your workspace, execute R4E in the runtime,
- Open R4E navigator view
- Create a review group
- Create a R4E review
To test the model:
- Right click on the EcoreModel project, then Select R4E (Find review Item)
- In the dialogue, just press ok, this will generate the review item for the testing

--> The handling of the model will be executed from the following class: UIEMFCompareUtils.createModelDeltas()
The error listed in the previous discussion will occurs when we try to open the EMF compare editor with the comparison of the model file: ecoreModels/model/ExtendedPO.ecorediag

Thanks
Jacques
Re: [EMF Compare] Compare editor return a text compare and not a model compare [message #1015578 is a reply to message #1015144] Fri, 01 March 2013 09:28 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1900
Registered: July 2009
Senior Member
Jacques,

There are a number of problems in there :

If I try and "compare with > ..." the ecorediag model, EMF Compare is simply not called. Please go to Window > Preferences, then General > Content-Types. In there, add "*.ecorediag" in the "Text > XML > XML Metadata Interchange (XMI)" content-type. There will soon be an "EMF Compare" specific content-type (planned for M6), but for now you can use the XMI one.

Second, even if you _do_ add the correct content-type, EGit will not call the necessary Team APIs to allow us to kick in and say that "ecorediag" cannot be compared alone : it needs to be compared along with its associated "ecore" file. Thus, the comparison will show a lot of "label" changes since we haven't loaded the associated ecore (everything is proxy, so every label, computed on the fly, changes). Label changes can be safely ignored, they are planned for deletion. As for EGit, we are currently working on its integration with the model providers, and a number of improvements are already in review from their side.

Laurent Goubet
Obeo
Re: [EMF Compare] Compare editor return a text compare and not a model compare [message #1015635 is a reply to message #1015578] Fri, 01 March 2013 13:37 Go to previous messageGo to next message
Jacques Bouthillier is currently offline Jacques BouthillierFriend
Messages: 5
Registered: May 2011
Junior Member
Hi Laurent,

I added the "*.ecorediag" in the content type. Just using the "compare with previous" option on different "model.ecorediag", I get null pointer exception. I am not even using R4E yet.

If it could help, I use in my configuration:
org.eclipse.emf.compare (2.1.0.201302050831) "EMF Compare Core"
org.eclipse.emf.compare.diagram.ecoretools (2.1.0.201302050831) "EMF Compare Core"
org.eclipse.emf.compare.diagram.gmf (2.1.0.201302050831) "EMF Compare Core"
org.eclipse.emf.compare.diagram.papyrus (2.1.0.201302050831) "EMF Compare Core"


Fist Null pointer:
java.lang.NullPointerException
at org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.DiagramMergeViewer.getEditPart(DiagramMergeViewer.java:189)
at org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.DiagramContentMergeViewer.updateContent(DiagramContentMergeViewer.java:333)
at org.eclipse.compare.contentmergeviewer.ContentMergeViewer.internalRefresh(ContentMergeViewer.java:743)
at org.eclipse.compare.contentmergeviewer.ContentMergeViewer.inputChanged(ContentMergeViewer.java:643)
at org.eclipse.jface.viewers.ContentViewer.setInput(ContentViewer.java:280)
at org.eclipse.compare.CompareViewerSwitchingPane.setInput(CompareViewerSwitchingPane.java:277)
at org.eclipse.compare.internal.CompareContentViewerSwitchingPane.setInput(CompareContentViewerSwitchingPane.java:158)
at org.eclipse.compare.CompareEditorInput.internalSetContentPaneInput(CompareEditorInput.java:845)
at org.eclipse.compare.CompareEditorInput.access$8(CompareEditorInput.java:843)



Second Null pointer:

Caused by: java.lang.NullPointerException
at org.eclipse.emf.compare.ide.ui.logical.RevisionedURIConverter.<init>(RevisionedURIConverter.java:108)
at org.eclipse.emf.compare.ide.ui.logical.EMFSynchronizationModel.resolveTraversal(EMFSynchronizationModel.java:464)
at org.eclipse.emf.compare.ide.ui.logical.EMFSynchronizationModel.createSynchronizationModel(EMFSynchronizationModel.java:165)
at org.eclipse.emf.compare.ide.ui.internal.structuremergeviewer.EMFCompareStructureMergeViewer.compareInputChanged(EMFCompareStructureMergeViewer.java:258)
at org.eclipse.emf.compare.ide.ui.internal.structuremergeviewer.EMFCompareStructureMergeViewer$1.run(EMFCompareStructureMergeViewer.java:243)
at org.eclipse.emf.compare.ide.ui.internal.structuremergeviewer.EMFCompareStructureMergeViewer$3.run(EMFCompareStructureMergeViewer.java:219)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
at org.eclipse.emf.compare.ide.ui.internal.structuremergeviewer.EMFCompareStructureMergeViewer.compareInputChanged(EMFCompareStructureMergeViewer.java:216)
at org.eclipse.emf.compare.ide.ui.internal.structuremergeviewer.EMFCompareStructureMergeViewer.inputChanged(EMFCompareStructureMergeViewer.java:544)

Best Regards
Jacques
Re: [EMF Compare] Compare editor return a text compare and not a model compare [message #1015670 is a reply to message #1015635] Fri, 01 March 2013 15:57 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1900
Registered: July 2009
Senior Member
Jacques,

I do not get NPEs from my side, but as I mentionned there is a lot of ongoing development both from our side and EGit to better support the logical models (the link between ecorediag and ecore, in your case). A lot of errors have been fixed already, but there are some that remains. For now, you should avoid comparing files from Git repositories with their remote revisions. This will already be much more stable by M6, the planned end of development for this integration is M7. Do note that even with M6, you will still need to update EGit to one of its latest versions to benefit from this.

Laurent Goubet
Obeo
Re: [EMF Compare] Compare editor return a text compare and not a model compare [message #1016158 is a reply to message #1015635] Tue, 05 March 2013 09:56 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1900
Registered: July 2009
Senior Member
Jacques,

There is an issue deeper in the framework that prevents EMF Compare from correctly loading your models. For now, you should avoid using projects which name don't match their containing folder: your project is named "EcoreModels", but it is contained in folder "ecoreModels" (notice the case difference). If you want a bigger picture for this issue, you can look at https://bugs.eclipse.org/bugs/show_bug.cgi?id=354801.

Avoiding this corner case should help you compare properly your models.

Laurent Goubet
Obeo
Previous Topic:[Teneo] createRegisterDataStore followed by deRegisterDataStore fails with NPE
Next Topic:[CDO] Reference old revisions
Goto Forum:
  


Current Time: Mon Aug 15 20:14:58 GMT 2022

Powered by FUDForum. Page generated in 0.02286 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top