How to create a copy of an EObject with non-null Resource [message #618948] |
Sat, 24 May 2008 16:15 |
Lars Schneider 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
|
|
|
Powered by
FUDForum. Page generated in 0.02068 seconds