Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » Is there a way to handle 'The object is not contained in a resource.' nicely from within ATL?
Is there a way to handle 'The object is not contained in a resource.' nicely from within ATL? [message #983915] Wed, 14 November 2012 08:46 Go to next message
Andreas Brieg is currently offline Andreas Brieg
Messages: 48
Registered: November 2012
Member
I have a refining transformation of the MoDisco Java model where I drop some if statements. When I run the transformation I get the error output:
Quote:

The object 'org.eclipse.gmt.modisco.java.emf.impl.SingleVariableAccessImpl(at)50f904b1
variable declaration = org.eclipse.gmt.modisco.java.emf.impl.SingleVariableDeclarationImpl(at)ca329ff (name: audit, proxy: false) (extraArrayDimensions: 0) (varargs: false)' is not contained in a resource.


This happens when the if statement
if(audit == null) {
    // other code here
}

contains a reference to the variable audit in its expression. But a variable declaration also contains a list of usageInVariableAccess that refers also to that expression of the if statement. So the variable access is a dangling reference after the if statement is dropped.

Is there a nice way to drop all such dangling references from within an ATL transformation?
Re: Is there a way to handle 'The object is not contained in a resource.' nicely from within ATL? [message #983929 is a reply to message #983915] Wed, 14 November 2012 09:00 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARD
Messages: 522
Registered: July 2009
Senior Member
drop everything that isn't needed anymore
Re: Is there a way to handle 'The object is not contained in a resource.' nicely from within ATL? [message #984234 is a reply to message #983929] Wed, 14 November 2012 14:23 Go to previous messageGo to next message
Andreas Brieg is currently offline Andreas Brieg
Messages: 48
Registered: November 2012
Member
The problem with this is, that it produces a lot of boiler plate code. You have to have a rule for every type which may have dangling references.
Re: Is there a way to handle 'The object is not contained in a resource.' nicely from within ATL? [message #984277 is a reply to message #984234] Wed, 14 November 2012 15:02 Go to previous messageGo to next message
Hugo Bruneliere is currently offline Hugo Bruneliere
Messages: 604
Registered: July 2009
Senior Member
With the current version of the refining mode, only the contained elements are automatically deleted when the container is "dropped".
If required, simply referenced elements (that are contained elsewhere) have to be explicitly deleted in other rules or via their container.

Hugo


------------------------------------------
Hugo Bruneliere - R&D Engineer
AtlanMod research team (Inria, EMN & LINA)
Ecole des Mines de Nantes
Nantes - France
------------------------------------------
Re: Is there a way to handle 'The object is not contained in a resource.' nicely from within ATL? [message #985163 is a reply to message #984277] Thu, 15 November 2012 07:44 Go to previous message
Andreas Brieg is currently offline Andreas Brieg
Messages: 48
Registered: November 2012
Member
There already exists a bug for that problem. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=332194
Previous Topic:How to compare model attribute that contains an enum with an enum constant?
Next Topic:ATL VM question about exclusive pattern matching execution
Goto Forum:
  


Current Time: Sat Sep 20 02:02:04 GMT 2014

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

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