|
Re: Exception when invoking a helper method [message #915036 is a reply to message #915025] |
Sun, 16 September 2012 08:27 |
Ed Willink Messages: 7655 Registered: July 2009 |
Senior Member |
|
|
Hi
It is very likely that an error message complaining about 'null' is
because at the point the error is generated the problem context is
indeed null.
You rule out 'self.classbody' nor 'key' being null but
- are they the correct contexts to rule out
- is your observation an observation of the actual state at the actual time
In the absence of anyone recognising the problem, you need to debug why
the Exception arises.
You may have more luck on the GMF newsgroup since this is unlikely to be
a QVTo problem.
Regards
Ed Willink
On 16/09/2012 08:35, Rami D. wrote:
> Hi,
>
> I've added a new helper method to the existing file
> xpt/diagram/editparts/Utils.qvto:
>
>
> helper getLabelText(classbody : String, key : String) : String {
>
> var s : String := classbody;
> ...
>
> return newStr;
> }
>
>
> Then i call this method from a template file
> «DEFINE figureText(key : String) FOR gmfgen::InnerClassViewmap»
> «getLabelText(self.classBody,key)»
> «ENDDEFINE»
>
>
> While generating the diagram code I get the following exception:
>
>
> Problems while generating code
> Exception (Cannot find operation (getLabelText(String, String)) for
> the type (null):in aspects::impl::diagram::editparts::NodeEditPart,
> line 34) while generating code
>
>
> I can rule out that neither 'self.classbody' nor 'key' is null,
> because when I use the arguments in the template itself, everything
> works fine. What could be the reason for that problem?
>
> Regards,
> Rami
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04664 seconds