Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community Forums[Xtend] Deleting Objects
https://www.eclipse.org/forums/index.php/mv/msg/169158/537013/#msg_537013
during an Xtend transformation I've created a lot of objects. In one
function, some of them get optimized away, so I delete them from their
eContainer.
Then I get an exception saying that an Element is not contained by any
resource.
How can I avoid such exception? I just want to create and delete an
object within the same Xtend transformation. Is that not possible?
Cheers,
Hauke]]>Hauke Fuhrmann2010-05-31T22:54:02-00:00Re: [Xtend] Deleting Objects
https://www.eclipse.org/forums/index.php/mv/msg/169158/537036/#msg_537036
> Hi there,
>
> during an Xtend transformation I've created a lot of objects. In one
> function, some of them get optimized away, so I delete them from their
> eContainer.
>
> Then I get an exception saying that an Element is not contained by any
> resource.
> How can I avoid such exception? I just want to create and delete an
> object within the same Xtend transformation. Is that not possible?
Such an error is usually raised when saving a resource which holds cross
references to EObjects which do not reside with a resource.
That is I suggest that the removed objects are cross referenced somewhere?
Sven
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Twitter : @svenefftinge
Blog : blog.efftinge.de]]>Sven Efftinge2010-06-01T06:18:55-00:00Re: [Xtend] Deleting Objects
https://www.eclipse.org/forums/index.php/mv/msg/169158/537079/#msg_537079
> Such an error is usually raised when saving a resource which holds cross
> references to EObjects which do not reside with a resource.
> That is I suggest that the removed objects are cross referenced somewhere?
Ah, thanks for the hint, Sven. The CrossRef stdlib functions revealed
cross references that haven't been removed. Now it works. Great :-)