|
|
Re: How to create a copy of an EObject with non-null Resource [message #419507 is a reply to message #419490] |
Sun, 25 May 2008 18:23 |
Cedric Brun Messages: 431 Registered: July 2009 |
Senior Member |
|
|
Hi Lars,
What EMF Compare build are you using ? The RC1 build should have fixed this
NPE (bug 230347 - see the release
notes :http://www.eclipse.org/modeling/emft/news/relnotes.php?proj ect=compare&version=0.8.0RC1 )
You should not have to provide your own match engine for such a thing :)
Cédric
Lars Schneider wrote:
> I think this problem is better of in this newsgroup.
>
>> 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
http://cedric.brun.io news and articles on eclipse and eclipse modeling.
|
|
|
Powered by
FUDForum. Page generated in 0.05342 seconds