Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » NullPointerException when merging model fragments / memory-only-models
NullPointerException when merging model fragments / memory-only-models [message #485147] Thu, 10 September 2009 15:24 Go to next message
Eclipse UserFriend
Originally posted by: duschl.creamteam.de

I get this exception when merging model instances which are't associated
with a ressource. (.eResource() == null)

java.lang.NullPointerException
at
org.eclipse.emf.compare.diff.merge.service.MergeFactory.getB estMerger(MergeFactory.java:111)
at
org.eclipse.emf.compare.diff.merge.service.MergeFactory.crea teMerger(MergeFactory.java:79)
at
org.eclipse.emf.compare.diff.merge.service.MergeService.doMe rge(MergeService.java:170)
at
org.eclipse.emf.compare.diff.merge.service.MergeService.merg e(MergeService.java:136)
at
org.eclipse.emf.compare.diff.merge.internal.impl.DiffGroupMe rger.applyInOrigin(DiffGroupMerger.java:35)
at
org.eclipse.emf.compare.diff.merge.service.MergeService.doMe rge(MergeService.java:174)
at
org.eclipse.emf.compare.diff.merge.service.MergeService.merg e(MergeService.java:136)
<snip>

I think that a resource is not strictly necessary at that point, because
reading on in the source, there is code to handle when the file extension
is null. Is there any workaround for that?
Re: NullPointerException when merging model fragments / memory-only-models [message #485172 is a reply to message #485147] Thu, 10 September 2009 17:08 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 15
Registered: July 2009
Junior Member
Josef,

> I think that a resource is not strictly necessary at that point, because
> reading on in the source, there is code to handle when the file extension
> is null. Is there any workaround for that?

I had the same problem. To solve it, i put the model in a resource before
comparing. A "dummy" resource is sufficient, since it is never saved.

Cheers,

Manfred
Re: NullPointerException when merging model fragments / memory-only-models [message #486157 is a reply to message #485172] Wed, 16 September 2009 14:37 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.
--------------060300040505000607070701
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit

Hi Manfred, Josef,

Which version of EMF Compare are you using? I fixed this (
https://bugs.eclipse.org/bugs/show_bug.cgi?id=258703 ) for the 0.9.0M4
last year.

Laurent Goubet
Obeo

Manfred a
Re: NullPointerException when merging model fragments / memory-only-models [message #486423 is a reply to message #486157] Thu, 17 September 2009 14:57 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 15
Registered: July 2009
Junior Member
Hi Laurent,

when i tried this some time ago i used emf version 0.8, but i have
recently upgraded to version 1.0 and i still get the same error, when a
model is not contained in a resource.

Cheers,

Manfred


laurent Goubet wrote:

> Hi Manfred, Josef,

> Which version of EMF Compare are you using? I fixed this (
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=258703 ) for the 0.9.0M4
> last year.

> Laurent Goubet
> Obeo
Re: NullPointerException when merging model fragments / memory-only-models [message #486424 is a reply to message #486423] Thu, 17 September 2009 15:00 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 15
Registered: July 2009
Junior Member
I just saw it is not the same error as in the bug report, the nullpointer
is at a different loaction:

java.lang.NullPointerException
at
org.eclipse.emf.compare.match.engine.GenericMatchEngine.mode lMatch(GenericMatchEngine.java:360)
at
org.eclipse.emf.compare.match.service.MatchService.doMatch(M atchService.java:162)
at
[..]






Manfred wrote:

> Hi Laurent,

> when i tried this some time ago i used emf version 0.8, but i have
> recently upgraded to version 1.0 and i still get the same error, when a
> model is not contained in a resource.

> Cheers,

> Manfred
Re: NullPointerException when merging model fragments / memory-only-models [message #486430 is a reply to message #486424] Thu, 17 September 2009 15:24 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.
--------------040900010706060905010202
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit

Manfred,

And now you know I don't yet have unit tests on this :(. That's a
regression I introduced after fixing the bug. I have reopened the bug
and expect not to close it before an unit test is commited ;).

Thanks for the feedback!

Laurent Goubet
Obeo

Manfred a
Previous Topic:xml transformation?
Next Topic:emf java error
Goto Forum:
  


Current Time: Sat Apr 27 03:44:16 GMT 2024

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

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

Back to the top