Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [EMF Compare] Compare file against nothing
[EMF Compare] Compare file against nothing [message #120546] Tue, 29 April 2008 14:25 Go to next message
David Michonneau is currently offline David MichonneauFriend
Messages: 85
Registered: July 2009
Member
One more question regarding ModelComparator: in case one of the resource
(left or right) is null, it is not able to run the diff. In that case I
would assume the diff is the whole non-null file.

Thanks,

David
Re: [EMF Compare] Compare file against nothing [message #120615 is a reply to message #120546] Tue, 29 April 2008 15:09 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------070902080707000201050607
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit

David,

Whether the comparison is made through the UI (thus via ModelComparator)
or through code (via MatchService and DiffService), We do assume that
each of the compared objects are loaded within a resource. Comparison
will fail in NullPointerException otherwise.

I will add this in the services' and engines' javadoc since I believe
this isn't documented anywhere.

Regards

Laurent Goubet
Obeo

David Michonneau a
Re: [EMF Compare] Compare file against nothing [message #120678 is a reply to message #120615] Wed, 30 April 2008 11:22 Go to previous messageGo to next message
David Michonneau is currently offline David MichonneauFriend
Messages: 85
Registered: July 2009
Member
Hi Laurent,

I might be wrong, but I believe this prevents to do diffs between a new file
in your workspace and a team repository (where the file is not present yet).
The text comparator usually shows the whole file content as the diff in
those cases.

I thought in the empty case, you could just instantiate an empty
ResourceImpl so that it works? I haven't tried it though, so it's just a
suggestion.

Thanks,

David

Stack trace with CVS:

Caused by: java.lang.NullPointerException
at
org.eclipse.emf.compare.ui.ModelCompareInput.getAncestor(Mod elCompareInput.java:155)
at
org.eclipse.emf.compare.ui.viewer.content.ModelContentMergeC ontentProvider.getAncestorContent(ModelContentMergeContentPr ovider.java:63)
at
org.eclipse.compare.contentmergeviewer.ContentMergeViewer.in ternalRefresh(ContentMergeViewer.java:697)
at
org.eclipse.compare.contentmergeviewer.ContentMergeViewer.in putChanged(ContentMergeViewer.java:615)
at org.eclipse.jface.viewers.ContentViewer.setInput(ContentView er.java:251)
at
org.eclipse.emf.compare.ui.viewer.content.ModelContentMergeV iewer.setInput(ModelContentMergeViewer.java:299)
at
org.eclipse.compare.CompareViewerSwitchingPane.setInput(Comp areViewerSwitchingPane.java:254)
at
org.eclipse.compare.CompareEditorInput.internalSetContentPan eInput(CompareEditorInput.java:784)
at
org.eclipse.compare.CompareEditorInput.access$7(CompareEdito rInput.java:782)
at
org.eclipse.compare.CompareEditorInput$13.run(CompareEditorI nput.java:722)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:67)
at
org.eclipse.compare.CompareEditorInput.feed1(CompareEditorIn put.java:716)
at
org.eclipse.compare.CompareEditorInput.feedInput(CompareEdit orInput.java:694)
at
org.eclipse.compare.CompareEditorInput.createContents(Compar eEditorInput.java:524)
at
org.eclipse.compare.internal.CompareEditor.createCompareCont rol(CompareEditor.java:399)
at
org.eclipse.compare.internal.CompareEditor.access$2(CompareE ditor.java:369)
at org.eclipse.compare.internal.CompareEditor$3.run(CompareEdit or.java:326)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:3 5)
at
org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchr onizer.java:123)
... 23 more

and another just before:
Caused by: java.lang.NullPointerException
at
org.eclipse.emf.compare.match.service.MatchService.doResourc eMatch(MatchService.java:197)
at
org.eclipse.emf.compare.ui.internal.ModelComparator$1.run(Mo delComparator.java:168)
at
org.eclipse.jface.operation.ModalContext$ModalContextThread. run(ModalContext.java:113)


"laurent Goubet" <laurent.goubet@obeo.fr> wrote in message
news:fv7dn0$ebd$1@build.eclipse.org...
> David,
>
> Whether the comparison is made through the UI (thus via ModelComparator)
> or through code (via MatchService and DiffService), We do assume that
> each of the compared objects are loaded within a resource. Comparison
> will fail in NullPointerException otherwise.
>
> I will add this in the services' and engines' javadoc since I believe
> this isn't documented anywhere.
>
> Regards
>
> Laurent Goubet
> Obeo
>
> David Michonneau a
Re: [EMF Compare] Compare file against nothing [message #120689 is a reply to message #120678] Wed, 30 April 2008 12:59 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------070308040306080905070008
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit

David,

Could you raise a bug on the bugzilla for this use case? Seems we need
to handle both cases : comparison of a local file not commited yet as
well as comparison of a locally deleted file with the latest from CVS.

Thanks for the feedback!

Laurent Goubet
Obeo

David Michonneau a
Re: [EMF Compare] Compare file against nothing [message #120708 is a reply to message #120689] Wed, 30 April 2008 13:51 Go to previous message
David Michonneau is currently offline David MichonneauFriend
Messages: 85
Registered: July 2009
Member
bugzilla https://bugs.eclipse.org/bugs/show_bug.cgi?id=229622 has been
filed.

Thanks,

David

"laurent Goubet" <laurent.goubet@obeo.fr> wrote in message
news:fv9qf3$3bi$1@build.eclipse.org...
> David,
>
> Could you raise a bug on the bugzilla for this use case? Seems we need
> to handle both cases : comparison of a local file not commited yet as
> well as comparison of a locally deleted file with the latest from CVS.
>
> Thanks for the feedback!
>
> Laurent Goubet
> Obeo
>
> David Michonneau a
Re: [EMF Compare] Compare file against nothing [message #617952 is a reply to message #120546] Tue, 29 April 2008 15:09 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------070902080707000201050607
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit

David,

Whether the comparison is made through the UI (thus via ModelComparator)
or through code (via MatchService and DiffService), We do assume that
each of the compared objects are loaded within a resource. Comparison
will fail in NullPointerException otherwise.

I will add this in the services' and engines' javadoc since I believe
this isn't documented anywhere.

Regards

Laurent Goubet
Obeo

David Michonneau a
Re: [EMF Compare] Compare file against nothing [message #617957 is a reply to message #120615] Wed, 30 April 2008 11:22 Go to previous message
David Michonneau is currently offline David MichonneauFriend
Messages: 85
Registered: July 2009
Member
Hi Laurent,

I might be wrong, but I believe this prevents to do diffs between a new file
in your workspace and a team repository (where the file is not present yet).
The text comparator usually shows the whole file content as the diff in
those cases.

I thought in the empty case, you could just instantiate an empty
ResourceImpl so that it works? I haven't tried it though, so it's just a
suggestion.

Thanks,

David

Stack trace with CVS:

Caused by: java.lang.NullPointerException
at
org.eclipse.emf.compare.ui.ModelCompareInput.getAncestor(Mod elCompareInput.java:155)
at
org.eclipse.emf.compare.ui.viewer.content.ModelContentMergeC ontentProvider.getAncestorContent(ModelContentMergeContentPr ovider.java:63)
at
org.eclipse.compare.contentmergeviewer.ContentMergeViewer.in ternalRefresh(ContentMergeViewer.java:697)
at
org.eclipse.compare.contentmergeviewer.ContentMergeViewer.in putChanged(ContentMergeViewer.java:615)
at org.eclipse.jface.viewers.ContentViewer.setInput(ContentView er.java:251)
at
org.eclipse.emf.compare.ui.viewer.content.ModelContentMergeV iewer.setInput(ModelContentMergeViewer.java:299)
at
org.eclipse.compare.CompareViewerSwitchingPane.setInput(Comp areViewerSwitchingPane.java:254)
at
org.eclipse.compare.CompareEditorInput.internalSetContentPan eInput(CompareEditorInput.java:784)
at
org.eclipse.compare.CompareEditorInput.access$7(CompareEdito rInput.java:782)
at
org.eclipse.compare.CompareEditorInput$13.run(CompareEditorI nput.java:722)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:67)
at
org.eclipse.compare.CompareEditorInput.feed1(CompareEditorIn put.java:716)
at
org.eclipse.compare.CompareEditorInput.feedInput(CompareEdit orInput.java:694)
at
org.eclipse.compare.CompareEditorInput.createContents(Compar eEditorInput.java:524)
at
org.eclipse.compare.internal.CompareEditor.createCompareCont rol(CompareEditor.java:399)
at
org.eclipse.compare.internal.CompareEditor.access$2(CompareE ditor.java:369)
at org.eclipse.compare.internal.CompareEditor$3.run(CompareEdit or.java:326)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:3 5)
at
org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchr onizer.java:123)
... 23 more

and another just before:
Caused by: java.lang.NullPointerException
at
org.eclipse.emf.compare.match.service.MatchService.doResourc eMatch(MatchService.java:197)
at
org.eclipse.emf.compare.ui.internal.ModelComparator$1.run(Mo delComparator.java:168)
at
org.eclipse.jface.operation.ModalContext$ModalContextThread. run(ModalContext.java:113)


"laurent Goubet" <laurent.goubet@obeo.fr> wrote in message
news:fv7dn0$ebd$1@build.eclipse.org...
> David,
>
> Whether the comparison is made through the UI (thus via ModelComparator)
> or through code (via MatchService and DiffService), We do assume that
> each of the compared objects are loaded within a resource. Comparison
> will fail in NullPointerException otherwise.
>
> I will add this in the services' and engines' javadoc since I believe
> this isn't documented anywhere.
>
> Regards
>
> Laurent Goubet
> Obeo
>
> David Michonneau a
Re: [EMF Compare] Compare file against nothing [message #617958 is a reply to message #120678] Wed, 30 April 2008 12:59 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------070308040306080905070008
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit

David,

Could you raise a bug on the bugzilla for this use case? Seems we need
to handle both cases : comparison of a local file not commited yet as
well as comparison of a locally deleted file with the latest from CVS.

Thanks for the feedback!

Laurent Goubet
Obeo

David Michonneau a
Re: [EMF Compare] Compare file against nothing [message #617960 is a reply to message #120689] Wed, 30 April 2008 13:51 Go to previous message
David Michonneau is currently offline David MichonneauFriend
Messages: 85
Registered: July 2009
Member
bugzilla https://bugs.eclipse.org/bugs/show_bug.cgi?id=229622 has been
filed.

Thanks,

David

"laurent Goubet" <laurent.goubet@obeo.fr> wrote in message
news:fv9qf3$3bi$1@build.eclipse.org...
> David,
>
> Could you raise a bug on the bugzilla for this use case? Seems we need
> to handle both cases : comparison of a local file not commited yet as
> well as comparison of a locally deleted file with the latest from CVS.
>
> Thanks for the feedback!
>
> Laurent Goubet
> Obeo
>
> David Michonneau a
Previous Topic:[EMF Compare] Broken Reference triggers a diff
Next Topic:[CDO] Problem with single Ecore, multiple packages
Goto Forum:
  


Current Time: Tue Apr 16 08:00:39 GMT 2024

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

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

Back to the top