Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » How to create a copy of an EObject with non-null Resource
How to create a copy of an EObject with non-null Resource [message #618948] Sat, 24 May 2008 16:15
Lars Schneider is currently offline Lars SchneiderFriend
Messages: 50
Registered: July 2009
Member
Hi,
I have a little problem using EcoreUtil.copy(EObject) because the
eResource() of that copy returns null.

More precisely I want to copy the root of a model, change it and compare
it to the original with EMF Compare. I think the following code snippet
explains it best:

//...
EObject copy = EcoreUtil.copy(original);
Transformation trans = new Transformation(copy);
trans.transform(); // changes copy
MatchModel match = null;
try {
match = MatchService.doMatch(original, copy
Collections.<String, Object> emptyMap());
} catch (InterruptedException e) {
e.printStackTrace();
}
//...

The problem is that doMatch(...) ends up in a NullPointerException
because the resource of copy is null. Does anyone have an idea how to
solve this problem? I think I can either set the resource manually or
get another IMatchEngine implementation. But I don't know how to.
Lars
Previous Topic:[CDO 0.8.0] Performance
Next Topic:[Teneo] Hiberante and Hbxml resource
Goto Forum:
  


Current Time: Fri Mar 29 07:53:53 GMT 2024

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

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

Back to the top