[EMF Compare] Compare file against nothing [message #120546] |
Tue, 29 April 2008 10:25  |
Eclipse User |
|
|
|
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 #617952 is a reply to message #120546] |
Tue, 29 April 2008 11:09  |
Eclipse User |
|
|
|
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 07:22  |
Eclipse User |
|
|
|
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 08:59  |
Eclipse User |
|
|
|
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
|
|
|
|
Powered by
FUDForum. Page generated in 0.03350 seconds