[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.m2m] Re: [ATL] NullPointerException--ERROR

Hi Rasha,

Rasha a écrit :
Hi all,

I try to copy some classes from a profiled source model to the target model. But I get this error SEVERE: ****** BEGIN Stack Trace
SEVERE: exception: SEVERE: null
java.lang.NullPointerException
at org.eclipse.m2m.atl.drivers.uml24atl.ASMUMLModelElement.realInvoke(ASMUMLModelElement.java:624)


at org.eclipse.m2m.atl.drivers.uml24atl.ASMUMLModelElement.invoke(ASMUMLModelElement.java:581)

at org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOperation.java:240)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.exec(ASMOperation.java:171)
at org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASMOclAny.java:143)


at org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASMOclAny.java:101)


I think the problem is in these helpers as the rest of the code works fine without them.


helper context UML!"uml::Element" def: getTaggedValue(stereo :
String ,tag : String) : UML!"uml::Element" =
self.getValue(self.getAppliedStereotype(stereo),tag);

helper context UML!"uml::Element" def : checkMyPropertyValue() : Boolean =
if (self.hasStereotype('MyStereotype')) then
if (self.getTaggedValue('MyStereotype','myProperty')-> exists (s| s.name <> 'value1')) then ...



The getTaggedValue helper you defined returns a single element (of type UML!uml::Element) and not a collection of elements. Thus you cannot do "self.getTaggedValue('MyStereotype','myProperty')-> exists" in another helper because "exists" is an operator on collections and not on single elements.



Any hint will be great,

Rasha



Best regards,

Hugo

--
--------------------------------------------------------
Hugo Bruneliere - R&D Engineer
ATLAS Group (INRIA & LINA) - University of Nantes
2, rue de la Houssiniere
44322 Nantes Cedex 3 - France
office +33 2 51 12 58 10 /\ cell.+33 6 07 42 45 30
EMail: Hugo.Bruneliere@xxxxxxxxxxxxxx
http://www.sciences.univ-nantes.fr/lina/atl/
--------------------------------------------------------